Home Segments Index Top Previous Next

414: Mainline

If you send the yourself message to an object, the answer produced is the object itself.

Thus, if you want the answer produced by such a cascaded expression to be the receiver, then send a yourself message at the end of the cascade:

Workspace
Transcript show: 
  (OrderedCollection new  
    addFirst: 570; 
    addFirst: 720;  
    addFirst: 640;  
    addFirst: 720;  
    yourself) 
  printString; cr 
Transcript 
OrderedCollection(720 640 720 570)