What is the difference between self and yourself in Smalltalk?
问题 In Smalltalk, there are two terms often found within a method body: self and yourself . What is the difference between them? 回答1: The reserved word self is a pseudo variable (you cannot assign to it) that refers to the current receiver of the method where it is used. On the other side yourself is a message you can send to any object to get that very same object. The implementation of yourself is yourself ^self meaning that the message yourself will behave as I just explained. The reason why