Home Segments Index Top Previous Next

41: Mainline

Suppose, for example, that you want to display 1746 in the transcript. First, you send a printString message to the Integer instance, 1746, which answers the String instance, '1746'. Then, you combine '1746' with show:, producing a show: message to be sent to Transcript:

  *-- The message receiver 
  | 
  |          *-- The message's method selector 
  |          | 
  |          |     *-- The message's argument 
  |          |     v 
  v          v   ---------------- 
Transcript show: 1746 printString 
           ----------------------  
                   ^ 
                   | 
                   *-- The message sent to the receiver 

Having prepared an expression such as Transcript show: 1746 printString in a workspace, you cause it to be evaluated by selecting it and clicking right > Do It. Evaluating the expression causes Smalltalk to display 1746 in the transcript.