What is the difference between = and == in Pharo Smalltalk?
问题 What is the difference between = and == in Pharo Smalltalk? What are they named, one isEqual and the other? = ~= equality / inequality (deep) == ~~ equality / inequality (shallow) 回答1: Yes, == is identity and it uses a primitive to compare if pointers point to the same address (i.e. same object). = is equality, meaning that two objects are equal, although they may be 2 different objects. By default = uses == , but it can be reimplemented. Also when you reimplement = it's advised to also