Home Segments Index Top Previous Next

323: Mainline

The recursivePowerOfTwo method is an instance of the recursive countdown pattern:

Integer method definition • instance 
method selector 
  self = 0 
    ifTrue: [^ result for self equal 0] 
    ifFalse: [^ combination receiver 
                combination selector 
                (self - 1) method selector]