The empty statement ";" - when is it useful?
Arthur Lloyd
via at google.com
Wed Jul 29 08:00:13 PDT 2009
Adam D. Ruppe Wrote:
> On Wed, Jul 29, 2009 at 10:29:51AM -0400, Arthur Lloyd wrote:
> > Also
> >
> > # struct coordinates { int x; int y; }
> > # coordinates getThem() { coordinates c; c.x = 4; c.y = 5; return c; }
> > # auto a = getThem();
> >
> > seems very verbose when in a scripting language I can do:
>
> It also seems very verbose in D where you can do:
>
> auto getThem() { return tuple(4,5); }
> auto a = getThem;
No, that looks quite good. Is the tuple() a D2 feature? D1/Tango doesn't seem to have it? Why not even go so far as to make the tuple keyword completely optional?
More information about the Digitalmars-d
mailing list