Macro to toggle a block of code without recompiling

This commit is contained in:
2023-12-04 11:21:30 -07:00
parent 33ad908143
commit df38b28e32

View File

@@ -12,3 +12,11 @@
((exprOr var prop localVar) true)
(_ false)) "the first argument to defAndReturn must be a symbol: var, prop, or localVar")
`{(,type ,name ,value) ,(b.symbol (symbolNameValue name true true))})
(defMacro quickToggle [toggleFlag &body body]
`{
(savedVar :Bool ,toggleFlag true)
(set ,toggleFlag ,toggleFlag)
(when ,toggleFlag
,@body)
})