Worst ideas/features in programming languages?
Timon Gehr
timon.gehr at gmx.ch
Sun Jan 9 10:05:18 UTC 2022
On 1/8/22 02:39, Walter Bright wrote:
> I'm concerned about what would happen to the following.
>
> All these are considered equivalent currently:
>
> (a,b,c)
> (a,(b,c))
> ((a,b,c))
> ((a,b),(c))
> ((a),(b),(c))
> ...
x is equivalent to (x). (Always, and a design that changes that is broken.)
Therefore, `(a,b,c)`, `((a,b,c))` and `((a),(b),(c))` are the same, a
triple with components a, b, and c.
> [Of course, using the __tuple syntax.]
>
> Does your proposal change that? I can't quite be sure.
`(a,(b,c))` is not the same as `((a,b),c)` in my proposals, those are
always pairs, where the second and first component, respectively, are
also pairs. Both are distinct from `(a,b,c)`, which is always a triple.
However, I don't propose to _change_ any existing auto-expanding
behavior, I want to add tuple syntax and actual tuple behavior for
something similar to a Phobos tuple. (I.e., based on a `struct` template.)
More information about the Digitalmars-d
mailing list