Tuple DIP
Steven Schveighoffer
schveiguy at yahoo.com
Wed Jan 17 01:20:14 UTC 2018
On 1/12/18 5:44 PM, Timon Gehr wrote:
> As promised [1], I have started setting up a DIP to improve tuple
> ergonomics in D:
>
> https://github.com/tgehr/DIPs/blob/tuple-syntax/DIPs/DIP1xxx-tg.md
Awesome! I can say I felt a lot more comfortable with the trailing-comma
syntax after our last discussion :)
> Before going ahead with it, I'd like some preliminary community input:
>
> - I'm not yet completely satisfied with the DIP.
> (See section "Limitations".)
> Please let me know suggestions or further concerns you might have.
In the section discussing the breaking changes with proposal 3, you say:
"The DIP author cannot see an obvious mitigation other than keeping
std.typecons.Tuple and core.object.__Tuple separate instead of aliasing
them."
Well, what if std.typecons.Tuple can detect whether it's being used in a
non-compatible way, and falls back on the original implementation? That
is, when it works, it's an alias to object.__Tuple/__tuple, when it
doesn't work, it's the old std.typecons.Tuple/tuple.
I would expect it not to be that difficult to detect, but you don't
specify exactly what the problems are so I'm not 100% sure I know what
you are talking about :) An example would help.
-----
About proposal 2, you say it's inspired by the conversation we had in
the forums. I remember the discussion, but I'm not seeing the
relationship with Proposal 2.
I also am not sure about the example. It defines some function max, and
then never uses it. I'm assuming somewhere there's a typo? In fact, I
think the example would compile today as it doesn't use any tuples (I
think), so I don't see the reason for it.
-Steve
More information about the Digitalmars-d
mailing list