I read that Blocks in Squeak and Pharo, since it was derived from Squeak did not implement true block closures and would not support block recursion. On one count the statement was correct, but not on the other. I tried:

    | a f |
    a := 0.
    f := [ Transcript show: a. (a < 5)ifTrue:[a := a + 1. f value ] ].
    f value.
    a inspect.

A Workspace DoIt did not work in Squeak, it failed complaning that the block was being evaluated. In Pharo, it works but with the annoying modal dialog asking to run since f was not assigned a value. If blocks are to be used recursively, a better way must be found to flag but not stop execution.

This example points out that porting from Squeak to Pharo is fine, but the reverse might be questionable.

bw

Reply via email to