From 10e514e1e08279bee097273021fdf4fe88f0f455 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 4 Jan 2021 08:45:24 -0700 Subject: [PATCH] Spec for better (or) handling in (case) --- src/test/cases/BasicTestCase.kiss | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/test/cases/BasicTestCase.kiss b/src/test/cases/BasicTestCase.kiss index cb53101..86e5518 100644 --- a/src/test/cases/BasicTestCase.kiss +++ b/src/test/cases/BasicTestCase.kiss @@ -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 myMap [=>"hey" "you"