Currently, the language has two main methods for defining equality: == and equals.
This duality is error prone and presents many implementation difficulties along with concerns related to overriding these methods or mixing them from mixins. Many objects of the wollok.lang and wollok.lib packages rely on the concept of equality and would be good to have a single interface to support it.
Necessary steps:
Ensure all equality in the WRE uses the == message instead of equals.
Drop sanity tests stating that overriding equals should impact the previous mentioned classes behavior.
On each implementation, change implementation of Set, assert, Dictionary and any other equality-based class to use only== and disregard equals.
Optionally, we could completely remove the equals method, or just leave it as it is now (only a method in Object that calls ==).
+1, @PalumboN @npasserini @lspigariol @clombardi. I'd like to remove equals in favor of ==. It is a huge change (reviewing papers, examples, etc.) What do you think?
Currently, the language has two main methods for defining equality:
==
andequals
.This duality is error prone and presents many implementation difficulties along with concerns related to overriding these methods or mixing them from mixins. Many objects of the
wollok.lang
andwollok.lib
packages rely on the concept of equality and would be good to have a single interface to support it.Necessary steps:
==
message instead ofequals
.equals
should impact the previous mentioned classes behavior.Set
,assert
,Dictionary
and any other equality-based class to use only==
and disregardequals
.equals
method, or just leave it as it is now (only a method inObject
that calls==
).