[Q] Block closures syntax

Brian Keefer mgomes21 at cox.net
Fri May 10 04:18:57 UTC 2002


> > Now if that is not a block closure, what else could one
> > possibly ask from a block closure ? Can someone post an example ?
> 
> arr _ (1 to: 5) collect: [ :i | [i]].
> arr do: [ :a | Transcript show: (a value printString); cr ]
> 
> prints 1 2 3 4 5 with closures, 5 5 5 5 5 in Squeak

If BlockContext>>storeString worked, you could just use a Tcl closure ;) 

arr _ (1 to: 5) collect: [ :i | Compiler evaluate: '[',i storeString,']'
].


There's time enough at last. -- Henry Bemis, 5D



More information about the Squeak-dev mailing list