-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Cider] Control node naming scheme proposal #2273
Comments
This looks like a great start! Could you add examples for multi-component programs? Also, what ensures that there never is a name clash? |
Thanks for starting this! I should mention: the current |
So for multicomponent programs the structure would essentially be the same just changing the leading component definition name. That of course refers to the control node in the definiton, rather than a particular instance. I suppose if we were interested in pointing to a particular control node in a particular instance you could further extend the beginning to be the fully qualified name of the cell rather than the component name, like so:
Could you say more about which name clashes you're concerned about? |
I guess the argument here is that there are no user-defined names and that statements of the same type get numbered, so there is no chance for a collision, correct? |
Yeah, that's more or less my though process. The only user defined names should be the component names themselves or the fully qualified name of the cell, neither of which should be able to clash. Children of |
The modified proposal, after a discussion with @sampsyo, looks like the following.
Where Annotating my example programs:
At the risk of bikeshedding on syntax, we don't need to use |
Per discussions with the broader team we are looking for a way to assign a consistent name to arbitrary nodes in a component's control program. These don't need to be 100% human-readable, but they should generally be intelligible. Ideally, we would also like something that has a close correspondence with the path from the root of the control program to the node of interest.
While we could imagine defining a standardized numbering schema where we simply begin counting up from the root, this is challenging to interpret without the program and somewhat error-prone. There are also some instances which are complicated by
if
statements since anif
can be written without an explicit false branch that is nevertheless present. I do think the idea would be useful for a more interactive specification when using Cider in debug mode, though.Instead, I propose something a little closer to a spelled out path traversal. Syntax is provisional for the moment. Consider the following program:
We can identify the root as
main::seq
and it's first child asmain::seq.0_enable
and so on for the subsequent children.par
blocks treat their children in much the same way.Consider:
Suppose we wish to refer to the invoke statement. Following the scheme we would have something like:
For
if
statements things are a bit less obvious since we need to be able to refer to one of two bodies.One choice would be to use numbers in much the same way as
seq
andpar
with 0 being the true branch and 1 being the false branch. Alternatively we could uset
andf
. Addressing the false branch in the above program would then be:or
Syntax suggestions welcome as I'm not entirely satisfied with underscore being the index separator but think it is harder to understand if things are run together sans separation.
The text was updated successfully, but these errors were encountered: