[parenscript-devel] Lexical scoping question

Vladimir Sedach vsedach at gmail.com
Mon Jun 8 18:20:29 UTC 2009


Special variables are still there, implemented using JS globals and
try-finally to rebind them. So the semantics of those should be the
same as that of CL as well.

Vladimir

On Mon, Jun 8, 2009 at 2:30 AM, Red Daly<reddaly at gmail.com> wrote:
>
>
> On Sun, Jun 7, 2009 at 11:46 PM, Vladimir Sedach <vsedach at gmail.com> wrote:
>>
>> So basically any form that introduces a lexical binding inside a
>> defun/lambda should correspond exactly to CL semantics (if not, it's a
>> bug!). Anything that's in the toplevel will either introduce a new
>> top-level lexical variable, or change the value of an existing one.
>
> I have not tried out the lexical scoping yet, so I cannot be sure how this
> works.  Is there a means of declaring variables special?  So if you have
>
> (defvar *g* 1)
>
> (defun foo ()
>    (let ((*g* 5))
>       (declare (special *g*))
>       (print-g)))
>    (print-g))
>
> (defun print-g () (print *g*))
>
> It will 51 and not 11 or 55?  I am unsure of the current semantics of
> let--whether anything is treated as dynamic and rebound, etc.  Is the manual
> up to date?
>
> Best,
> Red
>
>
>>
>> I guess one thing that can be done is to wrap any let forms in the
>> toplevel into a lambda that's called right then and there. I
>> personally don't like the toplevel/non-toplevel dimorphism in the
>> generated code so I'm not going to do it unless a compelling reason is
>> found.
>>
>> Vladimir
>>
>> > Daniel
>> >
>> > _______________________________________________
>> > parenscript-devel mailing list
>> > parenscript-devel at common-lisp.net
>> > http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
>> >
>> >
>>
>> _______________________________________________
>> parenscript-devel mailing list
>> parenscript-devel at common-lisp.net
>> http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
>
>
> _______________________________________________
> parenscript-devel mailing list
> parenscript-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
>
>




More information about the parenscript-devel mailing list