To everybody proposing "full" tuple returns
Bill Baxter
dnewsgroup at billbaxter.com
Tue Apr 15 01:07:48 PDT 2008
Janice Caron wrote:
> On 15/04/2008, Bill Baxter <dnewsgroup at billbaxter.com> wrote:
>> Right now from what I understand Tuple!(int,float) can be a return
>> value from a D2 function.
>
> Providing you import std.typecons, yes.
>
> There is an unfortunate ambiguity in the D docs about what a Tuple is.
> (http://digitalmars.com/d/2.0/tuple.html conflicts with
> http://digitalmars.com/d/2.0/phobos/std_typecons.html). I have
> submitted a bugzilla report about that. Anyway, a std.typecons.Tuple
> is what you want. That's the one that can be a return value from a D2
> function.
Oh.... I see. That's just a struct tuple with a bunch of ctfe code gen
inside. Dang. I thought Walter had made D2 able to return "classic"
Tuples.
Oh well.
The doc string has a great example ddoc at it's finest:
"""
A shortcut notation is $(D_PARAM obj.)_$(D_PARAM 0), $(D_PARAM
obj.)_$(D_PARAM 1) etc.
"""
Great. You have to run it through ddoc and a browser just to to find
out what the heck the mystery shortcut notation is.
--bb
More information about the Digitalmars-d
mailing list