[squeak-dev] Re: [Pharo-project] Prune stack serialization

Juan Vuletich juan at jvuletich.org
Fri Dec 2 19:30:19 UTC 2011


Eliot Miranda wrote:
>
>
> On Fri, Dec 2, 2011 at 10:55 AM, Mariano Martinez Peck 
> <marianopeck at gmail.com <mailto:marianopeck at gmail.com>> wrote:
>
>     Thanks both. I am right to assume that if the block refers to temp
>     vars, parameters, or whatever in another scope, then such solution
>     won't work. I mean, if I have this example for example:
>
>     | bytes result blah |
>     blah := 42.
>     bytes := FLSerializer serializeToByteArray: (SortedCollection
>     sortBlock: [:a :b | (a + blah) > b ]).
>
>     Then the 'blah' is in a different context. So the mentioned
>     solution works for "clean" closures, which are "self contained".
>     In the other cases (such as this example), we should serialize the
>     whole stack. Is this correct?
>
>
> No.  The closure implementation arranges that any and all temporary 
> variables accessed by the closure are directly accessible from the 
> closure without accessing the outer contexts.
>  ...

WRT clean closures, check what I did in Cuis to serialize 
SortedCollections. See implementors and senders of #isClean.

Cheers,
Juan Vuletich



More information about the Squeak-dev mailing list