I'm writing a macro for function / macro composition (mixed combinations are possible). Inside of the macro I have to treat symbols which represent functions and those that name macros differently. It is because result function must work with any number of arguments (if 'lowest' function in composition can), and I cannot apply apply
to macros. My question: how to determine what a given symbol represents: function or macro?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Macro:
CL-USER 8 > (macro-function 'bar)
NIL
CL-USER 9 > (macro-function 'lambda)
#<Function LAMBDA 41100B7E94>
Function:
CL-USER 15 > (and (fboundp '+)
(not (macro-function '+))
(not (special-operator-p '+)))
T