on Sat May 07 2016, Tyler Fleming Cloutier <cloutiertyler-AT-aol.com> wrote:
> That is a drastic solution indeed! How would this impact things like > Array<UIView>? While Array itself has value semantics, the aggregate > obviously does not as it contains references which usually be mutated > underneath us. > > Value semantics and mutation can only be measured with respect to > equality. The definition of == for all class types would be equivalent > to ===. Problem solved. > > Hmm, I get the feeling that I was arguing your own point back at you. Sorry, > Dave, I’m a little slow. :) > > Still, how would you generate an equality operator for a data structure that > requires wrapper classes currently, like a LinkedList? I don't think I understand the question. Maybe you should show me the specific LinkedList you're interested in. When you say “generate,” do you mean automatically? FWIWs: 1. I don't intend to make every == operator automatically-generated 2. A LinkedList can be defined using enums and no classes 3. Though it can be done, I am of the opinion that linked lists usually make poor value types. -- -Dave _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
