[parenscript-devel] Side effects between lexical scopes of two closures
Canhua
dreameration at gmail.com
Tue Feb 19 13:21:53 UTC 2013
To me separate bindings is expected. I suggest using gensym to compile
the binding var names.
On Fri, Feb 1, 2013 at 12:17 PM, Daniel Gackle <danielgackle at gmail.com> wrote:
> In the following, (FOO) should evaluate to 50, but actually evaluates
> to 90 because BAR's A binding has overwritten FOO's. Should they not
> have separate bindings?
>
> (progn
> (let ((a 5))
> (defun foo () (* 10 a)))
> (let ((a 9))
> (defun bar () (* 100 a))))
>
> var a = 5;
> function foo() {
> return 10 * a;
> };
> var a = 9;
> function bar() {
> return 100 * a;
> };
>
> Daniel
>
> _______________________________________________
> 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