ed8e37da62
Per the straw poll in #908, as an alternative to #1147. Now you must use `True`, `False`, and `None`, as in Python. Or just assign `true` to `True`, etc.; the old synonyms aren't reserved words anymore.
9 lines
248 B
Hy
9 lines
248 B
Hy
(defn test-when []
|
|
"NATIVE: test when"
|
|
(assert (= (when True 1) 1))
|
|
(assert (= (when True 1 2) 2))
|
|
(assert (= (when True 1 3) 3))
|
|
(assert (= (when False 2) None))
|
|
(assert (= (when (= 1 2) 42) None))
|
|
(assert (= (when (= 2 2) 42) 42)))
|