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@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@common-lisp.net
http://lists.common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel