recursive equal, and firstDifference functions

Jonathan M Davis jmdavisProg at gmx.com
Tue Mar 19 13:27:53 PDT 2013


On Tuesday, March 19, 2013 20:36:09 Dan wrote:
> On Tuesday, 19 March 2013 at 17:08:54 UTC, timotheecour wrote:
> > I think none of you got the point of equalRecurse, so let me
> > clarify.
> 
> I think I understand what you are after and I like the idea. I've
> got a few:
> 
> -typesDeepEqual
> -typesDeepCmp
> -deepHash

Those are what opEquals, opCmp, and toHash are for. It might make sense to 
define mixins which implement them for you (dealing with whatever recursive 
semantics are necessary), but using external functions for those just isn't 
going to fly. The language and standard library are designed around them being 
part of the types themselves. Stuff like AAs won't work if those functions 
aren't defined on the types themselves.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list