www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16458] New: std.typecons.namedTuple

https://issues.dlang.org/show_bug.cgi?id=16458

          Issue ID: 16458
           Summary: std.typecons.namedTuple
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: edder tkwsping.nl

Currently creating named tuples is a bit wordy:

Tuple!(double, "x", double, "y")(1.0, 2.0);


This could be simplified by adding a namedTuple function:

namedTuple!("x", "y")(1.0, 2.0);

I have an implementation in ggplotd (named aes [1]), which could be used if
people think this is a good idea.

[1] https://github.com/BlackEdder/ggplotd/blob/aes/source/ggplotd/aes.d#L82

--
Aug 31 2016