Multiple Tuple IFTI Syntactic Sugar

bearophile bearophileHUGS at lycos.com
Tue Feb 3 09:21:33 PST 2009


Bill Baxter:
> Wouldn't it be lovely if we could just use parentheses for that and he
> could call the function like:
>      Something!((t1,t2,t3),(s1,s2,s3))

Well, the compiler can use your clean syntax as syntactic sugar for something like the Record (that is a kind of struct) of mine:

Something!(record(t1, t2, t3), record(s1, s2, s3))

I don't know how much LDC/DMD are currently able to remove such temporary structs. It looks like an important optimization if you start using those Python-like types (Record) often enough.

I presume something like this will see the light in D2.

Bye,
bearophile



More information about the Digitalmars-d mailing list