Declaring Ref Variables Inside Function Calls

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Mar 31 17:57:30 PDT 2009


Leandro Lucarella wrote:
> Bill Baxter, el  1 de abril a las 05:22 me escribiste:
>> Right.  In my ideal world I could use tuples like this:
>>
>> (int,float) a;
>>
>> a = returns_tuple();
>>
>> a[0] = 2;
>> a[1] = 3.4;
>>
>> (int,float) z = returns_tuple();
>>
>> (int x, float y) = returns_tuple();
>>
>> auto tup = (2, 3.4);
>>
>> takes_int_and_float(unpack!(tup));
>>
>> I think experience with tuples in Python and ML (and probably
>> elsewhere -- heck even D) shows that tuples are incredibly useful.  So
>> useful that they deserve better syntax than Tuple!(...).
> 
> Agree. They should be first class citizen as dynamic arrays or hashes.

Why? Not grokking it.

Andrei



More information about the Digitalmars-d mailing list