Is this the correct way to reference `root` in new scopes?
I'm working through using the scope/module interface, to define new app-specific helper keywords to use.
There are a couple of cases where I want to have a new hierarchy of keywords, but I don't want to duplicate the constraint from the "parent" in the child.
For instance, if I have something like (as a contrived example):
Is
prefixedHex.type("root")
the correct/idiomatic way to refer to the regex above it or is there some simpler/cleaner to do it?
Thanks.2 Replies
This looks pretty reasonable to me, but another option would be tuple expressions. They allow you to use native scope syntax with expressions like pipe:
Every expression like pipe or narrow has an equivalent tuple expression you can see by selecting that syntax tab in the example on the docs
(most of them are just the corresponding operator in a tuple like
[A, "|", B]
for a union or [A, "[]"]
for an array)Ah, ok, that makes sense. Thank you.