Yes, that fixed it. Thanks!<br><br><div class="gmail_quote">On Sat, Sep 15, 2012 at 3:22 PM, Vladimir Sedach <span dir="ltr"><<a href="mailto:vsedach@gmail.com" target="_blank">vsedach@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for that bug report Dan. I'm not sure why that didn't come up earlier.<br>
<br>
I fixed the problem by getting rid of the whole loopResultVar thing -<br>
with the new RETURN transformations values can be returned directly,<br>
and that simplifies the generated code (and the Parenscript compiler)<br>
a lot.<br>
<br>
The fix is now pushed.<br>
<br>
Vladimir<br>
<div><div class="h5"><br>
On Fri, Sep 14, 2012 at 1:32 AM, Daniel Gackle <<a href="mailto:danielgackle@gmail.com">danielgackle@gmail.com</a>> wrote:<br>
> I just ran into a strange bug where the gensym'd suffixes on loop<br>
> control variables change to the wrong thing. The bug appears to be<br>
> triggered by a (RETURN) form inside a loop that has more than one<br>
> FOR clause. For each extra clause, the suffixes increase by one.<br>
> I haven't tried to track down the cause of the bug, but I did just push<br>
> a failing test (LOOP-PARALLEL-CLAUSES-WITH-RETURN) to<br>
> illustrate it.<br>
><br>
> (defun-js foo ()<br>
> (loop :for i :from 0 :below 10 :for x = (* i 10)<br>
> :when (> i 5) :do (return x)<br>
> :collect i))<br>
><br>
> => (note added comments below):<br>
><br>
> function foo() {<br>
> return (function () {<br>
> var collect3170 = [];<br>
> var loopResultVarSet3171 = null;<br>
> var loopResultVar3172 = null;<br>
> for (var i = 0; i < 10; i += 1) {<br>
> var x3171 = i * 10;<br>
> if (i > 5) {<br>
> loopResultVarSet3172 = true; // <---- suffix should be<br>
> 3171, not 3172<br>
> loopResultVar3173 = x3171; // <---- suffix should be<br>
> 3172, not 3173<br>
> break;<br>
> };<br>
> collect3170.push(i);<br>
> };<br>
> if (loopResultVarSet3171) {<br>
> return loopResultVar3172;<br>
> };<br>
> return collect3170;<br>
> })();<br>
> };<br>
><br>
> Daniel<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> parenscript-devel mailing list<br>
> <a href="mailto:parenscript-devel@common-lisp.net">parenscript-devel@common-lisp.net</a><br>
> <a href="http://lists.common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel" target="_blank">http://lists.common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel</a><br>
><br>
<br>
_______________________________________________<br>
parenscript-devel mailing list<br>
<a href="mailto:parenscript-devel@common-lisp.net">parenscript-devel@common-lisp.net</a><br>
<a href="http://lists.common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel" target="_blank">http://lists.common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel</a><br>
</blockquote></div><br>