Sort out the and/or/... ops.

This commit is contained in:
sforman 2023-07-30 15:51:29 -07:00
parent c0fa319c9c
commit 540bdd97bd
2 changed files with 16 additions and 2 deletions

View File

@ -267,6 +267,20 @@ dialect of Joy are defined in terms of these:
/\ \/ _\/_ (These are the logical ops. Booleans) /\ \/ _\/_ (These are the logical ops. Booleans)
+-----+-------------------+----------------+------------------------------+
| | Logical (Boolean) | Bitwise (Ints) | Short-Circuiting Combinators |
+-----+-------------------+----------------+------------------------------+
| AND | /\ | && | and |
+-----+-------------------+----------------+------------------------------+
| OR | \/ | || | or |
+-----+-------------------+----------------+------------------------------+
| XOR | _\/_ | xor | |
+-----+-------------------+----------------+------------------------------+
| NOT | not | ~ | |
+-----+-------------------+----------------+------------------------------+
-------------------------------------------------- --------------------------------------------------
Copyright © 2014 - 2023 Simon Forman Copyright © 2014 - 2023 Simon Forman

View File

@ -201,10 +201,10 @@ joy_function_eval symbol stack expression =
"=" -> "=" ->
joy_comparison_op (==) stack expression joy_comparison_op (==) stack expression
"and" -> "&&" ->
joy_binary_math_op Bitwise.and stack expression joy_binary_math_op Bitwise.and stack expression
"or" -> "||" ->
joy_binary_math_op Bitwise.or stack expression joy_binary_math_op Bitwise.or stack expression
"xor" -> "xor" ->