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

Daniel Gackle danielgackle at gmail.com
Fri May 18 13:40:13 UTC 2012


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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/parenscript-devel/attachments/20120518/733c65de/attachment.html>


More information about the parenscript-devel mailing list