OSDN Git Service

Runtime type checking for comparison ops.
authorsforman <sforman@hushmail.com>
Sat, 21 Oct 2023 19:17:21 +0000 (12:17 -0700)
committersforman <sforman@hushmail.com>
Sat, 21 Oct 2023 19:17:21 +0000 (12:17 -0700)
Because we're using Scheme Booleans for Thun Booleans there's no need to
make a special function for these, we can reuse the one for math ops.

implementations/scheme-chicken/joy.scm

index 572a4b5..4c3e7a2 100644 (file)
     ((/ div) (values (joy-math-func quotient stack) expression dict))  ; but for negative divisor, no!?
     ((% mod) (values (joy-math-func modulo stack) expression dict))
 
-    ((< lt) (joy-func < stack expression dict))
-    ((> gt) (joy-func > stack expression dict))
-    ((<= le) (joy-func <= stack expression dict))
-    ((>= ge) (joy-func >= stack expression dict))
-    ((= eq) (joy-func = stack expression dict))
-    ((<> != neq) (joy-func not-equal stack expression dict))
+    ((< lt) (values (joy-math-func < stack) expression dict))
+    ((> gt) (values (joy-math-func > stack) expression dict))
+    ((<= le) (values (joy-math-func <= stack) expression dict))
+    ((>= ge) (values (joy-math-func >= stack) expression dict))
+    ((= eq) (values (joy-math-func = stack) expression dict))
+    ((<> != neq) (values (joy-math-func not-equal stack) expression dict))
 
     ((bool) (joy-bool stack expression dict))