[phobos] Issue with opEquals(Object, Object)

Andrei Alexandrescu andrei at erdani.com
Mon Apr 26 14:33:14 PDT 2010


Yah, it's very close to that plus a few tests for null etc. I attach an 
excerpt from the camera-ready TDPL that discusses the matter. Please 
don't share - this is the final product!

Andrei

On 04/26/2010 04:19 PM, Steve Schveighoffer wrote:
> So something that was as simple as defining a single opEquals
> previously now must be done through a separate function call?
>
> Another option is to define opequals so the result is:
>
> a.opEquals(b) || b.opEquals(a)
>
> instead of using&&.
>
> In fact, that might be the best solution.  Do we need to generically
> handle the case where a says it's equal to b, but b says it's not
> equal to a?  Wouldn't that be the bizarre case that should be handled
> through named functions?
>
> -Steve
>
>
>
> ----- Original Message ----
>> From: Andrei Alexandrescu<andrei at erdani.com> To: Discuss the phobos
>> library for D<phobos at puremagic.com> Cc: Steve
>> Schveighoffer<schveiguy at yahoo.com> Sent: Mon, April 26, 2010
>> 4:25:12 PM Subject: Re: [phobos] Issue with opEquals(Object,
>> Object)
>>
>> That sounds a bit too complicated. opEquals is a simplified
>> collision
>>
> engine. If you want to define a full-fledged one, it may be simpler
> to
>>
> go the named functions route.
>
> Andrei
>
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: output.pdf
Type: application/pdf
Size: 159585 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/phobos/attachments/20100426/0978aa0c/attachment-0001.pdf>


More information about the phobos mailing list