A Discussion of Tuple Syntax

captaindet 2krnk at gmx.net
Mon Aug 19 16:17:18 PDT 2013


On 2013-08-19 17:04, Meta wrote:
> On Monday, 19 August 2013 at 21:03:50 UTC, Andrei Alexandrescu
> wrote:
>> b) syntactic support for ignoring certain members in a
>> destructuring - is that really needed?
>>
>> auto (a, ?, c) =
>> functionReturningTupleOrStaticArrayWith3Elements();
>
> In fairness, it is very common in other languages with pattern
> matching/destructuring. Off the top of my head I can think of
> Haskell, ML, Racket, Javascript (destructuring only) and Rust.

same in matlab. once destruction->auto assignment is available, (future) library functions will make heavy use of it, e.g. statistics functions returning lots of parameters/characteristics for a dataset. more often than not one is only interested in a few.

/det


More information about the Digitalmars-d mailing list