When is a closure a real one? [was: Real closures]
azreal1977 at hotmail.com
Sun Oct 8 18:48:44 UTC 2006
>From: "Michael Haupt" <mhaupt at gmail.com>
>Reply-To: The general-purpose Squeak developers
>list<squeak-dev at lists.squeakfoundation.org>
>To: "The general-purpose Squeak developers
>list"<squeak-dev at lists.squeakfoundation.org>
>Subject: Re: RE: When is a closure a real one? [was: Real closures]
>Date: Sun, 8 Oct 2006 18:17:22 +0200
>As for ^, it is *good* that it returns from the lexical
>context of the block it occurs in.
Yes I know. What I meant was: I think the presence of ^ means your block
can't be a complete closure. I.e. you can't return it from a method and
invoke it later, since it might try to return to a place that no longer
exists. I think the way ^ works is wonderful, but if the compiler sees one
in a block it can treat that block differently then if one wasn't present.
That is: if copying free variables is so expensive, then it can be avoided
at least in the case that a ^ is present in the block. You don't have to
copy the environment then because the block can't be passed upward anyway.
Did I make more sense this time or less? :)
More information about the Squeak-dev