I dun a DIP, possibly the best DIP ever

WebFreak001 d.forum at webfreak.org
Wed Apr 22 13:45:52 UTC 2020


On Wednesday, 22 April 2020 at 12:19:25 UTC, rikki cattermole 
wrote:
> Change it to something like .unpackSequence instead of ... and 
> I would be happy.

I'm for some other thing than ... too, in C++ it's a quite bad 
syntax and it can become very ugly to maintain with all the 
different combinations you could use it with from a compiler 
viewpoint. Additionally if you do miss some combinations or allow 
more complex operators it will quickly become a mess of "why does 
this compile but why doesn't this compile" or "why does this do 
something different"

I'm especially not a fan of allowing all of
(Tup*10)...  -->  ( Tup[0]*10, Tup[1]*10, ... , Tup[$-1]*10 )
and
(Tup1*Tup2)...
and
myArr[Tup + 1]... -> myArr[Tup[0] + 1], myArr[Tup[1] + 1], 
myArr[Tup[2] + 1]

would this be valid:
f!T...(x)
or rather this?
f!T(x)...

what does (cast(Tup)x)... evaluate to?

is f(Tup) and f(Tup...) now doing the same thing?

if
f(Items.x...)
works then what about
f(Items.MemberTup...) ?




More information about the Digitalmars-d mailing list