Open paolobrasolin opened 1 year ago
After #5 I've been giving some more thought to #6.
Right now the syntax for \wires is
\wires
\wires[<tikz keys>]{ <source node> = { <source anchor> = <target node>.<target anchor>, <source anchor> = <target node>.<target anchor>, ... }, <source node> = { ... }, ... }
Now, this is a two-levels nested prop, so you cannot repeat keys; specifically:
prop
<source node>
<source anchor>
While this is not a big deal when using numbered ports, it immediately becomes annoying when we use the boundary node to connect multiple boxes:
\wires{ % you can't @ = { west = A.west.1, west = A.west.2, }, % nor @ = { west = B.west.1 }, @ = { west = B.west.2 }, }
Of course you can just flip source and target to make this work, but this structure is inherently directional so you just create a different problem.
One solution is allowing the inner level to be a clist instead of an anchor name:
clist
\wires{ @ = { west = { A.west.1, A.west.2 } }, @.west = { B.west.1, B.west.2 }, }
If we can treat a single node name as a one-element clist in a trivial way, than this could be nice even at implementation level.
The only alternative i can think of is providing a separate list-of-pairs based command:
\wires*{ { @.west, A.west.1 }, { @.west, A.west.2 }, { @.west, B.west.1 }, { @.west, B.west.2 }, }
However, I strongly dislike the aesthetics of it.
Another issue emerged in #6 is providing non-global TikZ styles. I think this can also be solved by allowing richer syntax:
\wires[<tikz keys>]{ % global level <source node> = [<tikz keys>]{ ... }, % bundle level <source node> = { <source anchor> = [<tikz keys>]<target node>.<target anchor>, ... }, % wire level % and, if we implement the syntax discussed above, <source node>.<source anchor> = [<tikz keys>]{ ... }, <source node>.<source anchor> = { [<tikz keys>]<target node>.<target anchor>, ... }, <source node> = { <source anchor> = [<tikz keys>]{ ... } }, <source node> = { <source anchor> = { [<tikz keys>]<target node>.<target anchor>, ... } }, }
Now: would this actually be a good idea?
After #5 I've been giving some more thought to #6.
Right now the syntax for
\wires
isNow, this is a two-levels nested
prop
, so you cannot repeat keys; specifically:<source node>
at the top level<source anchor>
at the nested levelWhile this is not a big deal when using numbered ports, it immediately becomes annoying when we use the boundary node to connect multiple boxes:
Of course you can just flip source and target to make this work, but this structure is inherently directional so you just create a different problem.
One solution is allowing the inner level to be a
clist
instead of an anchor name:If we can treat a single node name as a one-element
clist
in a trivial way, than this could be nice even at implementation level.The only alternative i can think of is providing a separate list-of-pairs based command:
However, I strongly dislike the aesthetics of it.
Another issue emerged in #6 is providing non-global TikZ styles. I think this can also be solved by allowing richer syntax:
Now: would this actually be a good idea?