[Challenge] implementing the ambiguous operator in D

Peter Alexander peter.alexander.au at gmail.com
Thu Sep 2 00:06:08 PDT 2010


On 2/09/10 7:34 AM, Pelle wrote:
> It needs opEquals :-)

Yeah, it needs a lot of things :)

You could easily add unary operators as well (e.g. so that -amb([1, 2]) 
== [-1, -2]. I didn't bother adding more than I did because it would 
make the post too large, and wouldn't really add anything (I thought 
that the binary ops + dispatch covered most of the interesting cases).

Also, I think it would supposed to return amb(map!...) instead of just 
returning map!... (otherwise you couldn't chain them), but that's a 
simple fix.


More information about the Digitalmars-d mailing list