Replies: 2 comments 3 replies
-
I think a way to declare a common (abstract) superclass or a set of interfaces/modules per Node type could be useful, and that could then be used for this. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Sounds great, please cc me on the PR for that when you open it. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
With the introduction of kind we get much better documentation and generation potential (I am using it as Java types already in loading) but for many node types we do not have a single kind. It would be nice if we could get a proper list of kinds that something can be.
Let's look at HashNode as an example:
In elements we can have AssocNode and AssocSplatNode. It would be nice if we could add this knowledge to config.yml in some fashion. Some stream of consciousness ideas:
The tension between having a simpler syntax 1) or a new section 2) would depend on whether we want more information or not associated with this info. For example, if we want to specify that both Assoc and AssocSplat have a common value attribute then
perhaps we can add that. This would allow the template generator to know it can perhaps make a common interface or generate common method:
I spent maybe 10s thinking about actual syntax so do not take that seriously but the general goals would be:
I am not trying to make a type system in YAML but right now I spend a lot of time running bin/parse on syntax to try and see what nodes are children of other nodes. The idea of generating subtypes or interface for related node types has some appeal (ConstantPathNode+ConstantReadNode comes to mind).
Beta Was this translation helpful? Give feedback.
All reactions