Full Block Closure

Josh Flowers josh at i33.com
Thu Nov 18 18:17:37 UTC 1999


>--On Thursday, November 18, 1999, 12:41 PM -0500 "Josh Flowers"
><josh at i33.com> wrote: 
>
>> I keep hearing the need for "full block closure" in Squeak, what exactly
>is meant by this?
>> 
>
>A block is a bit of "anonymous" code, that is, it's code outside of a
>method:
>
>        [3+3]
>
>This *doesn't* evaluation to 6. Instead, it evaluated to a block object. You
>can get the value of a block by sending it the "value" message.
>
>        [3+3] value
>
>will yield 6.
>
>You can store them in variables.
>|aBlock|
>        aBlock := [3+3].
>        aBlock value.
>
>Will return 6.
>
>And blocks can have arguments as well. But they can't have "local" variables
>(i.e., temporaries). And they aren't fully reentrent, etc. In other words,
>they aren't full *closures* (or, in Scheme terminology, lamdas). They don't
>preserve their lexical environment.
>
>So they aren't *really* anonymous methods. They have special conditions on
>their use. Most smalltalks today make blocks be full closures.
>
>Hope this helps. It's a little garbled :)
>

No, it was actually quite clear (and what I thought, but didn't want to hear).  Thank you.





More information about the Squeak-dev mailing list