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

Vladimir Sedach vsedach at gmail.com
Fri Aug 7 01:04:16 UTC 2009


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
>
>




More information about the parenscript-devel mailing list