Tuple literal syntax

Simen kjaeraas simen.kjaras at gmail.com
Thu Oct 7 07:02:22 PDT 2010


Walter Bright <newshound2 at digitalmars.com> wrote:

> (a,b,c)[0]
>
> may be how the generative programming works, and that suggests:
>
> (a,0)[0]
>
> as how a user could generate a tuple of 1. Awkward, sure, but like I  
> said, I think this would be rare.

Wouldn't (a,0)[0] currently return a, not (a)? The syntax that behaves
as you describe would be slicing: (a,0)[0..1].

This said, read bearophile's post "Re: Tuple literal syntax + Tuple
assignment". It seems well thought-out, and I agree with all his
points.

-- 
Simen


More information about the Digitalmars-d mailing list