Block closures was: Block temps was: Porting from other
Christopher Oliver
oliver at fritz.traverse.com
Wed Aug 19 00:29:35 UTC 1998
> (Re-entrant) blocks that have their local copies of arguments, stack (and
> temps) per activation. You need to separate the block code-representing
> objects (where there would be, for example, one per literal block) from the
> block-activation representing objects (where there would be one per #value*
> message).
Actually, I think it should be a bit trickier still. Shouldn't a closure
capture its environment. Consider:
|a b c|
a _ [ :j | [ :i | i + j ]].
b _ a value: 4.
c _ a value: 10.
b value: 5
For closures, shouldn't the free variable of the inner block be bound
to the value of J at call time. I know my mind is polluted with Lisp
and ML, but it seems as though code/environment pairs are a touch more
complex than local copies.
Can someone unconfuse me?
Thanks,
--
Christopher Oliver Traverse Internet
Systems Coordinator 223 Grandview Pkwy, Suite 108
oliver at traverse.net Traverse City, Michigan, 49684
let magic f = fun x -> x and more_magic n f = fun x -> f ((n f) x);;
More information about the Squeak-dev
mailing list
|