3 ms·
Of course, but then 2 * 4 + 5. In Smalltalk evaluates to 18.
by chris_st 11y ago
Of course, but then
2 * 4 + 5.
In Smalltalk evaluates to 18.
- mpweiher 11y agoNo, 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/BitsOfHistory.pdf http://sdmeta.gforge.inria.fr/FreeBooks/BitsOfHistory/BitsOf... p. 21
- chris_st 11y agoAh, thanks. I sit corrected :-)