Home Segments Index Top Previous Next

90: Mainline

The following diagram shows what each part of the method definition does:

 *-- The method selector 
 |                
 v               *-- An optional comment 
-------------    | 
fatToCalories    v 
    ------------------------------------------------------------- 
    "Answer the calories in the receiver, viewed as grams of fat" 
    ^ self * 9 
    ^ -------- 
    |    ^ 
    |    | 
    |    *-- An expression to be evaluated 
    | 
    *-- Answer marker