ulisp-esp
ulisp-esp copied to clipboard
Value from return is evaluated an extra time
The value returned by return is incorrectly evaluated an extra time if the return clause is not the last expression within a progn and is within a loop, dotimes, or dolist block.
Expected:
21808> (let ((a 7)) (loop (progn (return 'a))))
a
Observed:
21808> (let ((a 7)) (loop (progn (return 'a) nil)))
7
Will be fixed next release.
What exactly is the "fix" you have? I don't see this problem in my fork (as of f5dc52a47161a4ab3370d53b589a02280315c063). I get the expected output:
{GC#1:50,8977/9044}[Ready.]
(let ((a 7)) (loop (progn (return 'a))))
a
My issue report is badly worded. the test to try is:
(let ((a 7)) (loop (progn (return 'a) nil)))
Correct answer 'a', wrong answer '7'.