[parenscript-devel] top-level LET and LET* will not create global variables

Vladimir Sedach vsedach at gmail.com
Fri Jul 27 21:39:24 UTC 2012


Hi,

That is indeed an reference in the manual to behavior that's been
fixed. Top-level LETs now get wrapped in functions and do not
introduce global variables. I've fixed the reference manual in the
repository and on the Parenscript website.

Thank you for the bug report.

Vladimir

On Fri, May 18, 2012 at 9:40 AM, Daniel Gackle <danielgackle at gmail.com> wrote:
> Hi Yakov,
>
> Yes, that does look inconsistent with the documentation. I use DEFPARAMETER
> if I need such a variable.
>
> Perhaps that line of documentation dates from before Vladimir implemented
> lexical scoping.
>
> By the way, Vladimir is traveling for a few months and most changes will
> probably have to wait until he is back.
>
> Daniel
>
>
> On Thu, May 17, 2012 at 5:48 PM, Yakov Zaytsev <yakov at clickgrab.net> wrote:
>>
>> Is this expected?
>>
>>
>>
>> CL-USER> (ql:quickload "parenscript")
>> ...
>> CL-USER> (defpackage :ps-user (:use :cl :ps))
>> #<The PS-USER package, 0/16 internal, 0/16 external>
>>
>> CL-USER> (in-package "PS-USER")
>> #<The PS-USER package, 0/16 internal, 0/16 external>
>>
>> PS-USER> (ps (let ((s-a))))
>> "(function () {
>>
>>     var sA = null;
>>
>>     return null;
>>
>> })();"
>>
>>
>>
>> Also,
>>
>> $ cat foo.lisp
>> (let ((s-a))
>>   (+ s-a 42)
>>   (chain s-a (append-child foo)))
>>
>>
>> PS-USER> (ps-compile-file "foo.lisp")
>> "(function () {
>>
>>     var sA = null;
>>
>>     sA + 42;
>>
>>     return sA.appendChild(foo);
>>
>> })();
>>
>> "
>>
>> PS-USER>
>>
>>
>> Which is against documentation "Top-level LET and LET* forms will create
>> new global variables, or overwrite the values of already existing global
>> variables with the same name."
>>
>> Please comment
>>
>> _______________________________________________
>> parenscript-devel mailing list
>> parenscript-devel at common-lisp.net
>> http://lists.common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
>>
>
>
> _______________________________________________
> parenscript-devel mailing list
> parenscript-devel at common-lisp.net
> http://lists.common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
>




More information about the parenscript-devel mailing list