Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: