You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I have a subgraph named "foo" that has a node "bar", and I want to name a node "foo-bar", the names will conflict and I will get nasty surprises.
This may sound far-fetched, and the obvious workaround is "don't do that", but nodes are supposed to be able to be used as black boxes, and I may not have written the subgraph myself.
I ran into this tonight, when I extracted a bunch of nodes into subgraph. One node was in, a filter for incoming messages to the main node in subgraph. Coincidentally I also wanted to filter incoming messages to the parent graph, which would be forwarded to subgraph, so the obvious name for that node was subgraph-in, and so subgraph-in ended up sending messages to itself.
Solution: Generate unique names for subgraph nodes as they are loaded and renamed -- keep track of these names so that internal and virtual edges do not miss their mark.
Probably use (gensym).
This is an issue that may result in cascading changes through the code base, so take care.
Also, consider whether the user will find error message mentioning 43__foo-57__bar useful. Maybe it's worth keeping both machine names and human-readable names around.
Alternative solution: Just use a weirder separator than -.
The text was updated successfully, but these errors were encountered:
Nice edge case find! I like the last suggestion, maybe -->> might be an appropriate. 43__foo-57__bar would drive me nuts. foo-->>bar-->>baz foo->bar->baz foo-->bar-->Ill-->stop-->bike-->shedding-->now
If I have a subgraph named "foo" that has a node "bar", and I want to name a node "foo-bar", the names will conflict and I will get nasty surprises.
This may sound far-fetched, and the obvious workaround is "don't do that", but nodes are supposed to be able to be used as black boxes, and I may not have written the subgraph myself.
I ran into this tonight, when I extracted a bunch of nodes into
subgraph
. One node wasin
, a filter for incoming messages to the main node insubgraph
. Coincidentally I also wanted to filter incoming messages to the parent graph, which would be forwarded tosubgraph
, so the obvious name for that node wassubgraph-in
, and sosubgraph-in
ended up sending messages to itself.Solution: Generate unique names for subgraph nodes as they are loaded and renamed -- keep track of these names so that internal and virtual edges do not miss their mark.
Probably use
(gensym)
.This is an issue that may result in cascading changes through the code base, so take care.
Also, consider whether the user will find error message mentioning
43__foo-57__bar
useful. Maybe it's worth keeping both machine names and human-readable names around.Alternative solution: Just use a weirder separator than
-
.The text was updated successfully, but these errors were encountered: