Opportunities for D
Meta via Digitalmars-d
digitalmars-d at puremagic.com
Tue Jul 8 17:39:50 PDT 2014
On Tuesday, 8 July 2014 at 22:21:43 UTC, bearophile wrote:
> Walter Bright:
>
>> but it doesn't go so far as creating a Unique!T type.
>
> What about the already present std.typecons.Unique?
>
>
> In your list I'd like to add another point:
> 9. Built-in tuples usable in all the most important situations
> (with a syntax that doesn't kill possible future improvements
> of the switch statement to perform basic pattern matching on
> structs that have an optional method named "unapply").
>
> Bye,
> bearophile
What if we had an "opDestructure" or "opMatch" or something like
that? It could return a tuple and be auto-implemented by the
compiler for simple structs/classes. Then users could precisely
control how their type can be destructured.
More information about the Digitalmars-d
mailing list