Unofficial wish list status.(Nov 2008)

KennyTM~ kennytm at gmail.com
Sat Nov 1 06:07:15 PDT 2008


Denis Koroskin wrote:
> On Sat, 01 Nov 2008 15:00:01 +0300, KennyTM~ <kennytm at gmail.com> wrote:
> 
>> ore-sama wrote:
>>> 4tuu4k002 at sneakemail.com Wrote:
>>>
>>>> 105  Multiple return values (tuples (#28)
>>>> int, int getPoint();
>>>> int a,b;
>>>> a,b = getPoint();
>>>  Provided we have lvalue array literals, this can fit to general 
>>> array operations rules:
>>> int[] getPoint();
>>> int a,b;
>>> [a,b]=getPoint();
>>
>> int code;
>> string msg;
>>
>> [code, msg] = getError();
> 
> This is now a tuple, its type is (int,string):
> (code, msg) = getError(); // more consistent, but less appealing

Right. It should be a tuple instead of an array for more generic variants.

I think this (x, y) = ... is just as good as [x, y] = ...



More information about the Digitalmars-d mailing list