[parenscript-devel] Side effects between lexical scopes of two closures

Daniel Gackle danielgackle at gmail.com
Fri Feb 1 04:17:28 UTC 2013


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


More information about the parenscript-devel mailing list