DIP32: Uniform tuple syntax

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 14 12:12:13 PDT 2014


Sean Kelly:

> This looks really nice.  I'd love to use it for std.concurrency,
> but I'm still trying to sort out a way for this to work.
> Specifically, it would be nice if there were a way to know from 
> a tuple's TypeInfo if it matches a pattern.

Elsewhere I have suggested to add to D an optional struct (and 
tuple) method now named onMatch, similar to the unapply method of 
Scala language, that is also called by the switch case to perform 
a basic version of pattern matching.

Bye,
bearophile


More information about the Digitalmars-d mailing list