Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This makes the compiler a little more consistent with the reader. Using the
_macro_
object's__getattr__
as a hook for overriding invocations (for example, making the module a Lisp-2) was a use case I intended at least since version 0.2.0 as mentioned in the old FAQ.When I actually tried doing it, I noticed that the compiler would require a small tweak. That's this change.
There are some subtleties around how dots should be handled. I might need more experience with this version before I can say if further changes are warranted. For use cases I'm imagining, I think local invocations with single dots like
(self.foo)
should be overridable, but external invocations with double dots like(builtins..print)
should not, although(foo.._macro_.bar)
should probably be overridable via thefoo.
module's_macro_
rather than the local one.It's a bit tricky because
foo.bar.baz
is different from(getattr foo 'bar.baz)
.