[dmd-concurrency] Pattern matching on message receives, error handling
Sean Kelly
sean at invisibleduck.org
Wed Jan 13 11:00:47 PST 2010
On Jan 13, 2010, at 10:55 AM, Andrei Alexandrescu wrote:
>
> For the OO crowd, I think this will be quite useful:
>
> class Handler
> {
> bool receive(int x) { ... }
> bool receive(int x, double y) { ... }
> bool receive(string s, int x) { ... }
> ...
> }
>
> auto h1 = new Handler;
> auto h2 = new Handler;
> receive(h1, h2); // dispatches automatically
> // starting from h1
>
> Sean, may I put this in confidence that you'll find the time to implement it? Walter, we may need some introspection chops for that too.
Sure. Hopefully tupleof and/or __traits will be enough, but I guess we'll see.
More information about the dmd-concurrency
mailing list