4 ms·
They both (in this case): 1. are at least a little bit wrong. 2. Never use FLET or LABELS I think we can rule out #2. Function capture is a legitimate probl
by aidenn0 6y ago
They both (in this case):
1. are at least a little bit wrong.
2. Never use FLET or LABELS
I think we can rule out #2. Function capture is a legitimate problem that does (admittedly rarely) happen in real-world code.
The thing that makes writing hygienic macros possible in CL today is the package system. It's disallowed to rebind functions from the CL package, so if your macros only rely on non-exported symbols from your package and symbols in the CL package, then you are free from any hygiene problems that aren't caused by code that is clearly bad locally (that is code that binds internal symbols of other packages; any "::" in use should be immediately flagged by a code review.)
- tines 6y ago> if your macros only rely on non-exported symbols from your package and symbols in the CL package, then you are free from any hygiene problems that aren't caused by code that is clearly bad locally Not quite true, recursive macro invocations that create bindings can step on themselves and force you to use GENSYM, even if your criteria are satisfied.
- aidenn0 6y agoThe "interesting" macro hygiene problems can't be solved with GENSYM. I was assuming it was understood that proper macros should use GENSYM for generated bindings.