After #5 I've been giving some more thought to #6.
Right now the syntax for \wires is
\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:
- you cannot repeat
<source node> at the top level
- you cannot repeat
<source anchor> at the nested level
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:
\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
\wiresis\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:<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
clistinstead of an anchor name:\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
clistin 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:
Now: would this actually be a good idea?