let (x,y) = ...

Leandro Lucarella via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Tue Feb 24 06:59:19 PST 2015


Nick Treleaven, el 19 de February a las 17:25 me escribiste:
> On 19/02/2015 17:00, Nick Treleaven wrote:
> >>>Alternatively std.typetuple.TypeTuple can be used instead of let
> >>
> >>not for ranges and arrays though
> >
> >Yes, but `tuple` overloads could be added for those.
> 
> Or not - the length isn't known at compile-time.
> 
> >Tuple already
> >supports construction from a static array:
> >
> >     int a, b;
> >     TypeTuple!(a, b) = Tuple!(int, int)([3, 4]);
> 
> I'm hacking std.typecons so this does work:
> 
>     TypeTuple!(a, b) = [4, 5].tuple;

Why not to integrate this "let" to phobos, that seems to be a lot of
syntactic noise compared to : let (a, b) = [4, 5];

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
You can try the best you can
If you try the best you can
The best you can is good enough


More information about the Digitalmars-d-announce mailing list