If a function name or a symbol in a quoted list in the body of defmacro! starts with g!, then defmacro! will generate a binding to a gensym for it, which will then be unused, leading to a warning from the compiler. The possible solutions I can think of are either to add ignorable declarations in the let statement for the generated symbols, or perhaps to walk through the body statements, finding the symbols which start with g! and defining each of them as symbol macros which append a clause to the let-statement which generates the symbols (perhaps by creating shared list structure in that let-statement using the ,. operator? I'm not sure.) and then returns the g! symbol itself. The second of these seems more "correct" at least to me, but also far more complicated and maybe completely misguided or impossible.
If a function name or a symbol in a quoted list in the body of
defmacro!
starts withg!
, thendefmacro!
will generate a binding to a gensym for it, which will then be unused, leading to a warning from the compiler. The possible solutions I can think of are either to addignorable
declarations in thelet
statement for the generated symbols, or perhaps to walk through the body statements, finding the symbols which start withg!
and defining each of them as symbol macros which append a clause to thelet
-statement which generates the symbols (perhaps by creating shared list structure in thatlet
-statement using the,.
operator? I'm not sure.) and then returns theg!
symbol itself. The second of these seems more "correct" at least to me, but also far more complicated and maybe completely misguided or impossible.