[Issue 6365] AutoTupleDeclaration

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jul 23 12:04:22 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6365



--- Comment #13 from bearophile_hugs at eml.cc 2011-07-23 12:04:19 PDT ---
Tuple slicing and other situations create tuples with 1 items or 0 items:

auto t = tuple(1.5, "foo");
auto t1 = t[0 .. 1];
auto t2 = t[0 .. 0];

In python they are written:
(x,)  or x,
()

For the 1-tuple D may do use the same syntax (but here parentheses are
requires, while in Python they are optional):
auto (x,) = [10];
auto (y,) = t1;

What about 0-length tuples?
int[0] a;
() = a;
() = t2;

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list