What is yourself method used for?
Ans. yourself method returns self. It is usually used while cascading messages like add: . | aCollection | aCollection :=3D OrderedCollection new add: 1; add: 2; yourself. In the above example add: returns its argument, not the receiver. Therefore, yourself message is sent to do the proper assignment of an OrderedCollection to aCollection variable.
Ans. yourself method returns self. It is usually used while cascading messages like add: . | aCollection | aCollection :=3D OrderedCollection new add: 1; add: 2; yourself. In the above example add: returns its argument, not the receiver. Therefore, yourself message is sent to do the proper assignment of an OrderedCollection to aCollection variable.