> On 1-Sep-07, at 4:57 AM, Slava Pestov wrote:

> The position of the local on the
> retain stack is not a property of the local, but if the local+current
> lexical scope. So there's no one definition of 'b' that would work.
> That's why you need the closure conversion.

In the example:

        [| a b c | a b + c + ]

There's a sort of "environment", stored on the retain stack, a mapping of
{ a b c } to positions { 0 1 2 }. So when you say that the index is not a 
property of the local, is it because when you do closure conversion, the 
index for that symbol may be shifted in order to accomadate new elements in 
the "environment"? If that's the case, then perhaps the new additions to the 
environment should appear at the bottom of the retain stack. If the retain 
stack is:

        0 1 2
        a b c

And the body introduces a new locals expression with d e f, then the 
environment would be:

        0 1 2 3 4 5
        a b c d e f

At some point, if a new 'a' is introduced, it's no problem:

        0 1 2 3 4 5 6
        a b c d e f a

So now the index of the local is a property of the local. I think there maybe 
a drawback. Your closures are "smart" in that they only copy the part of the 
environment they need; these closures would always get the whole thing.

Ed

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to