[self-interest] blocks and closures

James McCartney asynth at io.com
Thu Apr 10 18:34:11 UTC 2003


On Wednesday, April 9, 2003, at 10:31 PM, tb at becket.net wrote:

> James McCartney <asynth at io.com> writes:
>
>> It depends on the Smalltalk.
>> A full closure can be returned from a function and still refer to that
>> function's variables. Self disallows this, as do some Smalltalks I
>> beleive. If you support this feature you can no longer put all your
>> local variables on the stack, because references to them may outlive
>> the function activation in which they were created.
>
> This is a fiction that the Smalltalk crowd likes to talk about, and
> it's a shame that the Self crowd also repeats it.

I'm probably not in the Self crowd since I've yet to actually run it. 
My own language does support full closures. I think you didn't read my 
words as carefully as I wrote them.

>
> In languages which support closures, it is rare to return them.  Most
> functions never return them.  So you can store such local variables on
> the stack just fine, for all but the minority of functions which
> return closures.

I said you can't store "all" local variables on the stack. Which is 
certainly the case.

-- 
--- james mccartney   james at audiosynth.com   <http://www.audiosynth.com>
SuperCollider - a real time synthesis programming language for the 
PowerMac.




More information about the Self-interest mailing list