[parenscript-devel] Loop return values don't get returned
Daniel Gackle
danielgackle at gmail.com
Wed Apr 11 02:22:58 UTC 2012
Commit 83f4ea appears to have implemented return values from loop
expressions, which is great and something I've wanted for a long time.
But there seems to be a bug insofar as the return values never
actually get returned:
An example is this FOR loop - foo() should return 40 but returns NaN (10 *
null) instead:
(defun foo ()
(* 10 (for ((i 0)) ((< i 10)) ((incf i))
(when (> i 3)
(return i)))))
=>
function foo() {
return 10 * (function () {
var loopResultVar6945 = null;
for (var i = 0; i < 10; ++i) {
if (i > 3) {
loopResultVar6945 = i;
break;
};
};
loopResultVar6945;
})();
};
I get the same result using the LOOP macro, and WHILE loops have the same
problem.
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/parenscript-devel/attachments/20120410/53cfc85f/attachment.html>
More information about the parenscript-devel
mailing list