disable ifLet in defMacro bodies

This commit is contained in:
2021-10-28 13:31:17 -04:00
parent 6fc53634f1
commit c8c407aad3
3 changed files with 44 additions and 1 deletions

View File

@@ -79,4 +79,14 @@
(function _testSetMacroVar []
(Assert.equals 1 (_testSetMacroVarMacro))
(Assert.equals 2 (_testSetMacroVarMacro)))
(Assert.equals 2 (_testSetMacroVarMacro)))
// ifLet and its derivatives should be disabled in defMacro bodies:
(defMacro _testIfLetDisabledMacro []
(assertThrows (ifLet [a "b"] a))
(assertThrows (whenLet [a "b"] a))
(assertThrows (unlessLet [a "b"] a))
`null)
(function _testIfLetDisabled []
(_testIfLetDisabledMacro))