DIP32: Uniform tuple syntax

Sean Kelly via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 14 12:04:54 PDT 2014


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.  For example, would
something like this work:

receive( ({1, $} x) { ... do something with tuple x },
               ({2, $} x) ... );

I suppose it might be possible to say whether a tuple is {int,
stuff}, then deserialize it into a variable and compare against
the pattern explicitly?  Though maybe this would end up requiring
me to parse the mangled name of the tuple type?


More information about the Digitalmars-d mailing list