> On Mar 13, 2017, at 10:54 AM, Sean Heber via swift-evolution 
> <swift-evolution@swift.org> wrote:
> 
> I’m dumb when it comes to proper hashing, but it’s such a tediously common 
> thing in my experience to need to add Hashable to some kind of a struct so I 
> can stash it in a set or use it as a dictionary key. Is there really no way 
> to make this all more automatic? I have to be honest - this proposal seems 
> *harder* to understand than the way it works now. Of course the easiest would 
> be if the language could just do this “good enough" for me using reflection 
> or whatever and if I really did run into a problem where I wanted to do this 
> myself, I could override something.
> 
> Perfect is the enemy of good.

The compiler totally ought to derive reasonable default Equatable and Hashable 
implementations for you. That would allow the standard library to do the right 
thing without burdening most users with the need to sweat the details.

-Joe
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to