Lexical closures in Squeak

Anthony Hannan ajh18 at cornell.edu
Wed Aug 14 02:10:34 UTC 2002


Tim Rowledge <tim at sumeru.stanford.edu> wrote:
> Anthony Hannan has done a great deal of work towards fixing the lack
> of proper closures and is currently working on revising his code to work
> with plain Contexts instead of the explicitly stacked system he worked
> up. This will make it nice and simple to adapt to any dynamic
> translation or even static translation system that appears. Should make
> it nice and easy to do continuations and coroutining too.
> 
> Anthony, Ian and I (and maybe others? I don;t remember) had a discussion
> some time ago and concluded that the explicit stack mechanism got in
> the way of vm implementation flexibility. Sort of an "it breaks
> Deutsch's rule" situation.

Hello guys,
	I'm currently working on the next version of block closures.  It should
be ready real soon.  I haven't got rid of the stack, I have just
simplified access to it so it can be hidden in the VM if we want.  I
haven't hidden it yet however, since it is nice to be able to manipulate
it in Smalltalk when simulating.  Once the code has settled I can change
the stack access code to primitives.  Like before, MethodContexts still
exist but act like PseudoContexts - they get their state from the stack
frame.  This should fit nicely with a Jitter.  And as before, the Debugger,
Exceptions, and most other Smalltalk code access execution state through
MethodContexts, not the stack; the stack is just there for speed. 
BlockContexts don't exist in the block closure version, BlockClosures
do, and when called use MethodContexts in exactly the same way as
regular methods.
Cheers,
Anthony



More information about the Squeak-dev mailing list