[Q] Block closures syntax

Martin Drautzburg martin.drautzburg at web.de
Thu May 9 20:59:40 UTC 2002


I understand that squeak does not have true block closures, right ?
But then I was pleased to see that the following

|y|
Foo := [:x|
        y ifNil: [y:=0].
        y := x + y.
        Transcript show: y; cr.
]
Foo value:1.

does maintain the value of y and prints increasing values, even though
        Transcript show: y asString;cr. 
prints nil.

Now if that is not a block closure, what else could one
possibly ask from a block closure ? Can someone post an example ? 



More information about the Squeak-dev mailing list