Re: Why no SYMBOL-MACRO-FUNCTION?
- From: Kaz Kylheku <kkylheku@xxxxxxxxx>
- Date: Tue, 31 Jul 2007 16:45:44 -0000
On Jul 31, 7:04 am, Pillsy <pillsb...@xxxxxxxxx> wrote:
It's not so hard to find the expansion function associated with an
ordinary macro---you just use MACRO-FUNCTION. Finding information
about the function or value associated with a symbol is similarly
straightforward. There doesn't seem to be as good a way for doing the
same with a symbol: AFAIK the best you can do is check the second
return value of macroexpand.
Interestingly, HyperSpec clearly talks about symbol macros having a
function. Obviously, it's just a trivial function that returns the
specified expansion, so it's not particularly interesting. If there
were a SYMBOL-MACRO-FUNCTION, it wouldn't be that useful unless it was
assignable.
The functionality of a custom function behind a symbol macro can be
obtained by expanding the symbol to compound form that calls an
ordinary macro.
There's also no good way to get rid of a symbol-macro definition for a
symbol; FMAKUNBOUND works for regular macros, but for some reason
MAKUNBOUND doesn't work for symbol macros,
I would regard that as an implementation bug, since the symbol macro
is a kind of binding, and the requirement for MAKUNBOUND is to just
remove the symbol's binding. There is no clause there to exclude
symbol macros. Just my interpretation.
.
- References:
- Why no SYMBOL-MACRO-FUNCTION?
- From: Pillsy
- Why no SYMBOL-MACRO-FUNCTION?
- Prev by Date: Re: Is Lisp a Blub?
- Next by Date: Re: Why no SYMBOL-MACRO-FUNCTION?
- Previous by thread: Why no SYMBOL-MACRO-FUNCTION?
- Next by thread: Re: Why no SYMBOL-MACRO-FUNCTION?
- Index(es):