(setMacroVar) instead of (defMacroVar)

This commit is contained in:
2021-11-11 13:31:04 -07:00
parent 6b387fd932
commit 37b12052a6
4 changed files with 16 additions and 3 deletions

View File

@@ -60,7 +60,7 @@
(_testPrintAtMacroTimeMacro)
(Assert.pass))
// Calling (set) on a macroVar is a faux-pas, but calling defMacroVar again is not
// Calling (set) on a macroVar is a faux-pas, because (setMacroVar) is the right way
(defMacroVar count 0)
(defMacro _testSetMacroVarMacro []
(assertThrows (set count (+ count 1)))
@@ -71,7 +71,7 @@
(Assert.pass))
(defMacro _testRedefineMacroVarMacro []
(defMacroVar count (+ count 1))
(setMacroVar count (+ count 1))
(symbol (Std.string count)))
(function _testRedefineMacroVar []