conditional \#when and \#unless

This commit is contained in:
2021-07-12 13:36:40 -06:00
parent 709a34ebdc
commit 3cf0d66a27
3 changed files with 37 additions and 5 deletions

View File

@@ -1,3 +1,16 @@
(defvar runningInHaxe (#if interp true false))
(defvar runningInPyOrJs (#if (or py js) true false))
(defun number []
(let [&mut num 5]
(#when interp
(+= num 5)
(-= num 4))
num))
(defun number2 []
(let [&mut num 12]
(#unless interp
(+= num 5)
(-= num 8))
num))