-
Notifications
You must be signed in to change notification settings - Fork 3
Implement Builtin Expander (Macro System) #15
Comments
Perhaps we could use an interface to "tag" values as macros? type Macro interface{
Macro()
} We would then wrap a type macro struct{ Seq }
func (macro) Macro() {} Then we can just type-assert against the |
No, we need to tag the value of the operator to indicate macro or not. We don't need to tag the entire For example, in the invocation form We could introduce a type Macro struct {
Name string // macro name.
Args []string // argument names.
Body Any
} In above example,
|
Ah gotcha! Ok this makes sense. I’ll have a think. |
@spy16 I'm going to start working on your proposed implementation. Just a heads up so that we don't duplicate any work 🙂. |
@spy16 Ok, so as much as I hate to admit it, I think I've bitten off more than I can chew! I think you probably have a much more complete picture of how macro expansion fits into our current architecture, whereas every attempt I've made so far ends up requiring major changes in other parts of the codebase ... a sure sign that I'm Doing It Wrong! 😅 I'm unassigning myself from this issue, and letting you take over. My latest attempt can be found in the Sorry about this 😞 |
No worries. Let me take a stab at this. 🙂 |
I will try to do this over this weekend. sorry for the slow progress here. have been extremely busy. |
No worries, and thanks for the update! 🙂 |
BuiltinExpander
that expandsSeq
based macro-invocation forms.Need to figure out how a symbol/value would be identified as a
macro
(Clojure uses a^:macro
tag)The text was updated successfully, but these errors were encountered: