Home Segments Index Top Previous Next

125: Mainline

Suppose that you define three methods: the outerParameterDisplay: method calls the middleParameterDisplay: method, which, in turn, calls the innerParameterDisplay: method. All three methods happen to use aParameter as a parameter.

As shown in the following illustration, each use of aParameter is fenced. Also, none of the methods happen to use self, so all the receiver integers are ignored:

Integer method definition • instance 
outerParameterDisplay: aParameter 
  Transcript show: 'Value inside outerParameterDisplay: '; 
             show: aParameter printString; 
             cr. 
  self middleParameterDisplay: 2. 
  Transcript show: 'Value inside outerParameterDisplay: '; 
             show: aParameter printString; 
             cr 
Integer method definition • instance 
middleParameterDisplay: aParameter 
  Transcript show: 'Value inside middleParameterDisplay: '; 
             show: aParameter printString; 
             cr. 
  self innerParameterDisplay: 1. 
  Transcript show: 'Value inside middleParameterDisplay: '; 
             show: aParameter printString; 
             cr 
Integer method definition • instance 
innerParameterDisplay: aParameter 
  Transcript show: 'Value inside innerParameterDisplay: '; 
             show: aParameter printString; 
             cr 
Workspace
4 outerParameterDisplay: 3 
Transcript 
Value inside outerParameterDisplay: 3 
Value inside middleParameterDisplay: 2 
Value inside innerParameterDisplay: 1 
Value inside middleParameterDisplay: 2 
Value inside outerParameterDisplay: 3