Timon Gehr:

My bikeshed is colored one of these:

(:1,2)
(|1,2)


At that point you might as well just use

import std.typecons : q = tuple, Q = Tuple;

Q!(int, int) foo(){
    return q(1, 2);
}

If built-in tuples are not going to look like

(1, 2)

then imho we might as well leave them out,

But the banana syntax doesn't look bad:

(||)
(|1|)
(|1, 2|)
(|1, 2, 3|)

It's short enough, it's not visually noisy, it's simple enough to
type, it consistently avoids the problems with literals for
0-tuples and 1-tuples, and it's sufficiently intuitive once you
have seen it one time. It's just a bit longer to type than the
syntax with simple (), that has problems with the shorter tuples.

The now dead Fortress language used several similar syntaxes,
like (|...|), {|...|}, [|...|], etc.

Bye,
bearophile

Reply via email to