Matching with std.concurrency receive

Jonathan M Davis jmdavisProg at gmx.com
Sat Dec 10 11:38:42 PST 2011


On Saturday, December 10, 2011 17:30:50 Adam wrote:
> Hrm... that's a bit problematic. If I do use the exact match, it seems
> to hang / lock up (probably the lack of support for classes?).
> However, that's pretty much never the case of what I want to do, since
> what I'm trying to do involves passing / accepting an interface and
> its implementations.
> 
> I guess I can manage this with a static table of operation IDs
> pointing to function delegates. Sadness. Haha

It probably _should_ accept interfaces for classes and the like, but I don't 
think that it works properly for classes at the moment (due to issues with 
Variant), and in my experience, I've had use the _exact_ type, as annoying as 
that may be. For instance, if IIRC, I tried to pass a string which happened to 
be immutable, and when I tried to receive string on the other end, it wouldn't 
work until I changed it to receive an immutable string.

If you have a type A which you think definitely should be receivable as type B 
on the other side, and it doesn't work, please submit a bug report: 
d.puremagic.com/issues . It's possible that you're misunderstanding something, 
but it's also definitely a possibility that receive just doesn't work right in 
some cases (e.g. far too strict). A bug report increases the chances of it 
getting fixed.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list