I periodically go hunting for this trick to override macros with lexically-scoped variables: http://www.arclanguage.org/item?id=13606 Everytime I'm like, wait, why isn't this in anarki? And I spend an hour or so digging around before I realize why. Hopefully writing this up will fix it in my memory. The issue is in overriding common macros like with and unless: (mac updating (place ? with t unless 'iso . body)
..)
(http://arclanguage.org/item?id=12975; https://github.com/akkartik/arc/blob/e93b4121dd/arc.arc#L497)Now you can't use with in the body. Perhaps that's ok, but you also can't use let because let calls with and all the levels of macroexpansion happen within the same lexical scope. In effect, overriding macros with lexical scope causes lexically-scoped vars to sometimes act like dynamic scope. |