I am trying to teach myself Small Talk. This is a brief example of a loop:
| I | I: = 5 [I & gt; 0] while true: [transcript show: (i * 2) asString); Million I: = i-1. ].
As I understand, while there is a message sent to a blockclosure, as long as the receiver is true, it asks for the blockcloses to run the blockclones.
Despite the creation of a loop in Smalltalk, how is the message sent during blocking calls? Or is this applied in any language written in run-time?
In my viewworks image, it is done with recurring:
< B> whileTrue: aBlock ^ self value ifTrue: [aBlock value. [Self value] while true: [ablok value]]
However, there is also a note for the effect that the compiler will be inline for a time: call: if both receivers and logic are literal blocks, so in most cases In, you can see #whileTre: one of the "magic" messages that look like a message send in a syntactically, but in reality it is optimized in various bytecodes under the hood.
Comments
Post a Comment