← Back to context

Comment by igouy

5 days ago

Isn't practical in Smalltalk either, so the compiler does something special:

    ifFalse: alternativeBlock
        "Answer the value of alternativeBlock. Execution does not actually
         reach here because the expression is compiled in-line."

        ^alternativeBlock value

Oh thanks, I didn't know that. I thought it just relied on the explicit code blocks.

But yeah, this is a pretty critical point for optimizations - any realistic language is likely to optimize this sooner or later.