Brainstorming....
So, if you use
:f_(a, Left, Right, [obj])
Then you can't do
:f_(a, Left, Right, [obj])[0..999].SomeValue
Because the result of flatten is a structure with the keys d,k,v. And if you append "[0..999].V.SomeValue" to access SomeValue in V, then you loose the structure keys...
Solution is simple
:f_(a, Left"add .SomeValue here", Right, [obj])
Of course you can't, because you need the object in the key "Left", so that the object can be used in the next iteration of flatten. (SomeValue may be an int or string on that object)
What is needed is, that the key has 2 parts
1) get the object (which will be used for further iteration)
2) get the display part from that object (that will be in "v" of the [obj])
So a separator is needed between the 2 parts of the key. I personally favour the ":" (as it is in var a:int;)
:f_(a, Left:SomeValue, Right:SomeValue, [obj])
Which means, get the next object for the iteration from Left and Right.
But in the output show only Left.SomeValue.
So far so good. Only downside: the ":" is also used in
And the colon can start an intrinsic.
Yet, there is no case where that would make it ambiguous. It can always be clearly detected as one and only one of those.
But it is like the "case else" if you have an large nested "if then else" in the case section before.
E.g. you can have
:f_(a,
:_.x ? :_.Left1 : :_.Left2 : :_.y ? :_.SomeValue1 : :_.SomeValue2,
Right:SomeValue,
[obj]
)
On the other hand I really think the colon is the most natural choice...