[parenscript-devel] Bug with ==

Daniel Gackle danielgackle at gmail.com
Tue Mar 2 21:59:50 UTC 2010


(let ((x 10) (y 10) (z 10))
  (= x y z))

is true Common Lisp, but the PS equivalent...

var x = 10;
var y = 10;
var z = 10;
x == y == z;

... is false. The left operand of the second == is actually x==y, which
evalutes to true, and true==z of course is false. An equivalent in CL might
be:

(equal (equal x y) z)

Perverse side note: the above example doesn't work if you assign 1 to the
variables because in JS, the following is true:

1 == true

I didn't know this. JS still manages to shock me sometimes.

Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/parenscript-devel/attachments/20100302/3d1baded/attachment.html>


More information about the parenscript-devel mailing list