behavior chased to incorrect definition of not. Fixed\!
This commit is contained in:
parent
2148cb047e
commit
3335aa2cf5
|
@ -89,7 +89,7 @@
|
||||||
(format "(~a === RUNTIME.NULL)" (first checked-operands))]
|
(format "(~a === RUNTIME.NULL)" (first checked-operands))]
|
||||||
|
|
||||||
[(not)
|
[(not)
|
||||||
(format "(!(~a))" (first checked-operands))]
|
(format "(~a === false)" (first checked-operands))]
|
||||||
|
|
||||||
[(eq?)
|
[(eq?)
|
||||||
(format "(~a === ~a)" (first checked-operands) (second checked-operands))])))
|
(format "(~a === ~a)" (first checked-operands) (second checked-operands))])))
|
||||||
|
|
|
@ -687,7 +687,7 @@
|
||||||
|
|
||||||
Primitives['not'] = function(MACHINE) {
|
Primitives['not'] = function(MACHINE) {
|
||||||
var firstArg = MACHINE.env[MACHINE.env.length-1];
|
var firstArg = MACHINE.env[MACHINE.env.length-1];
|
||||||
return (!firstArg);
|
return (firstArg === false);
|
||||||
};
|
};
|
||||||
Primitives['not'].arity = 1;
|
Primitives['not'].arity = 1;
|
||||||
Primitives['not'].displayName = 'not';
|
Primitives['not'].displayName = 'not';
|
||||||
|
|
|
@ -141,6 +141,10 @@ EOF
|
||||||
(test '(displayln (not (not 3)))
|
(test '(displayln (not (not 3)))
|
||||||
"true\n")
|
"true\n")
|
||||||
|
|
||||||
|
(test '(displayln (not 0))
|
||||||
|
"false\n")
|
||||||
|
|
||||||
|
|
||||||
(test '(displayln (add1 1))
|
(test '(displayln (add1 1))
|
||||||
"2\n")
|
"2\n")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user