Spec for better (or) handling in (case)

This commit is contained in:
2021-01-04 08:45:24 -07:00
parent f21b4378f6
commit 10e514e1e0

View File

@@ -340,7 +340,17 @@
(otherwise (Assert.fail)))
(case 5
((when false (or 5 6)) (Assert.fail))
(otherwise (Assert.pass))))
(otherwise (Assert.pass)))
// TODO in Haxe,
// `switch (Some(true)) { case Some(true | false): "a"; default: "b"; }`
// returns "a", so this should also be valid:
/*(case (Some true)
((Some (or true false))
(Assert.pass))
(otherwise (Assert.fail)))*/
// ^ Implement by overriding the `or` macro with an `or` special form to return variadically nested OpOr binop exps
// in KissState.forCaseParsing() instead of handling CallExp(Symbol(or)) specially
)
(defun _testMaps []
(deflocal :Map<String,String> myMap [=>"hey" "you"