3 ms·
If macros are marked as different to functions at the callsite, then do they need to be marked different at the definition site? Most functions return a non-Exp
by vorg 15y ago
If macros are marked as different to functions at the callsite, then do they need to be marked different at the definition site? Most functions return a non-Expr value, but could return a Expr if the program's job is manipulating them. Most macros return a Expr, but could return a literal for insertion into the code.
So I'm wondering does a programming language which marks macro expansions different to function calls (as Julia does with the @ prefix) really need to distinguish functions from macros in the definition (as Julia does with the 'function' and 'macro' keywords) ?
- samth 15y agoTemplate Haskell, which uses an explicit mark at macro calls (a $), doesn't require marking macro definitions explicitly, so it can certainly be done.