Collecting Blocks

Ned Konz ned at bike-nomad.com
Sun Nov 17 17:33:17 UTC 2002


On Sunday 17 November 2002 09:27 am, Derek Brans wrote:
> Can some explain why
>
> ((1 to: 2) collect: [:ea | [ea asString]]) collect: [:b | b value]
>
> evaluates to: #('2' '2')
>
> How do you collect blocks properly?

You've run into the fact that blocks aren't full closures yet.
The current (hackish) way to deal with this problem is to use 
fixTemps:

((1 to: 2) collect: [:ea | [ea asString] fixTemps ]) collect: [:b | b 
value]

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE




More information about the Squeak-dev mailing list