|
|
|
|
|
by rntz
4107 days ago
|
|
Yup, I pretty much want it to be trivially easy for define macros that are themselves macro-extensible. It's definitely possible to do this in Lisp, but: (a) it's not a well-known technique (b) it's not in the standard library of any Lisp I know of (c) there are interesting open design questions to be answered in the implementation of such a system I hope this article will get folks thinking about these issues. For example, walking the AST and calling macroexpand will work, but then you can't have a macro that expands differently in different contexts - when interpreted as an expression versus as a pattern, for example. I think this is an important feature. |
|
This[0] may be of some help. You could set it to expand macros differently according to the current context (some global variable).
You could also write your own macroexpand function which would default to the implementation's macroexpand.
This is definitely something interesting to think about. Thank you for the discussion.
[0] http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec...