> On 24 Oct 2017, at 22:48 , Peter Uhnák <i.uh...@gmail.com> wrote: > > > Why the assignment of the new code is delayed until the end of the bloc > > execution? > > The assignment is performed immediately, but the old code is still being > executed. Once the value was sent to the block, the block started executing > and is no longer under the control of the HotSwapping object.
Another way of looking at this is to ask yourself what is the granularity of the think that you are changing. In your original example, you made a new assignment to currentBlock, but the code (operating on the old value of currentBlock) does not re-read this variable each time aroind the loop. It reads it just once, before it starts looping. So changing it afterwards won’t matter. In contrast, suppose that you were to recompile a new version of Trasncript>>#show: while your loop is running. The version that is currently executing would finish, but the next time that #show: is sent to Transcript, you would execute the new version.