[parenscript-devel] Bug: incorrect JS emitted for binary operators with more than 2 operands

Daniel Gackle danielgackle at gmail.com
Fri Aug 7 01:12:56 UTC 2009


Given that the code currently emitted is incorrect, it's not like you have
to worry about backward compatibility. Throwing an error would probably
suffice.

On Thu, Aug 6, 2009 at 7:04 PM, Vladimir Sedach <vsedach at gmail.com> wrote:

> I ran across this bug a long time ago. The equivalent of (> x y z) in
> JS would be (x > y) & (y > z). 'y' is evaluated multiple times, so
> you'd need to introduce a temporary variable for it. I wonder if there
> is any other approach (other than limiting the comparison operator to
> two arguments)?
>
> Vladimir
>
> On Wed, Aug 5, 2009 at 1:45 PM, Daniel Gackle<danielgackle at gmail.com>
> wrote:
> > PS generates code for expressions like (> x y z) as if the operators
> worked
> > the same way in JS and Lisp, but they don't. For example,
> >
> > (ps (> 3 2 1))
> >  => "3 > 2 > 1;"
> >
> > ... is an expression that is true in Lisp but false in JS.
> >
> > Daniel
> >
> > _______________________________________________
> > parenscript-devel mailing list
> > parenscript-devel at common-lisp.net
> > http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
> >
> >
>
> _______________________________________________
> parenscript-devel mailing list
> parenscript-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/parenscript-devel/attachments/20090806/0b311f39/attachment.html>


More information about the parenscript-devel mailing list