Multiple Tuple IFTI Syntactic Sugar

bearophile bearophileHUGS at lycos.com
Tue Feb 3 07:24:11 PST 2009


dsimcha:
> I guess the bottom line is that, yes, this is too much of a niche feature.

Yes, but I think in D tuples have to nest. Their auto-flattening is a design mistake to be fixed, IMHO (even Perl6 fixes this).

Another solution is to use a record() like the one in my dlibs, you can pass two of them to your function. It's less handy than your preferred syntax (and maybe slower too, if the compiler isn't smart enough to remove intermediate structs).
See record() here: http://www.fantascienza.net/leonardo/so/dlibs/func.html

Bye,
bearophile



More information about the Digitalmars-d mailing list