In Lil, the "&" and "|" operators provide logical AND and logical OR. Both "conform" to the elements of lists:
(1,1,0,0) & (1,0,1,0) # -> (1,0,0,0) (1,1,0,0) | (1,0,1,0) # -> (1,1,1,0)
To be more precise, these operators are actually binary "minimum" and "maximum" operators for numbers:
(1,2,3,4) & 2 # -> (1,2,2,2) (1,2,3,4) | 2 # -> (2,2,3,4)
As always, be careful to remember that Lil expressions are carried out right-to-left unless you include parentheses.
For comparisons, Lil has < (less), > (more), and = (equal). It does not have "compound" symbols like "<=", ">=", or "!=". If you want the complementary operation, you can use ! (negation):
a > b # a is more than b ! a > b # a is not more than b (a <= b) a < b # a is less than b ! a < b # a is not less than b (a >= b) a = b # a is equal to b ! a = b # a is not equal to be (a != b)
Note that all of these operations work to lexicographically compare strings, too:
"Apple" < "Aardvark","Blueberry" # -> (0,1) "Apple" & "Aardvark","Blueberry" # -> ("Aardvark","Apple") "Apple" | "Aardvark","Blueberry" # -> ("Apple","Blueberry")
Lil syntax highlighting profiles for vim, emacs, and Sublime Text are available at the Decker Github Repo.
Syntax highlighting is also available in the Lil Playground.