3 ms·
Why? You know which macro made the identifiers. You know what this macro consumed. In most practically important cases this is sufficient. But, yes, you cannot
by sklogic 11y ago
Why? You know which macro made the identifiers. You know what this macro consumed. In most practically important cases this is sufficient.
But, yes, you cannot do it with the Common Lisp approach, where macros operate on bare lists, not the scheme-like syntax objects. The problem here is that the lists had been stripped from the important location metadata. For this reason I had to depart from the simple list-based macros and using custom syntax extension with rich ASTs underneath. Still, on top of a Lisp.
- lmm 11y agoEven with location information, if the IDE's going to offer autocomplete inside the macro it would need to be able to invert the way the macro transforms identifiers, which is not possible to do to arbitrary code. I agree that this is very rarely practically important - but if you think about it that's precisely the fact that a more restricted alternative to macros should be adequate.