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 Gackledanielgackle@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@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel