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

Smalltalk messages/methods:

   a in: set.
   2 * 4.
Just sayin'


Of course, but then

    2 * 4 + 5.
In Smalltalk evaluates to 18.


No, that's 13. You probably meant

  4 + 5 * 2.
Also:

Compilation Order: Smalltalk-78 had perpetuated the post-evaluation of receiver expressions so as to avoid delving into the stack to find the receiver. In the Smalltalk-80 language, however, we encoded the number of arguments in the send instruction. This enabled strictly left- to-right evaluation, and no one has since complained about surprising order of evaluation. We suspect that this change will yield further fruit in the future when someone tries to build a very simple compiler.

http://sdmeta.gforge.inria.fr/FreeBooks/BitsOfHistory/BitsOf... p. 21


Ah, thanks. I sit corrected :-)




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

Search: