Home Segments Index Top Previous Next

779: Mainline

Suppose that you added category and protocol information to the definitions presented in Segment 556. If you use a compact rendering of what you would see in the system browser—a rendering that includes category and protocol information—you have the following:

Weight class definition 
Magnitude subclass: #Weight 
  instanceVariableNames: 'magnitude' 
  classVariableNames: '' 
  poolDictionaries: '' 
  category: 'Experiment' 
Weight method definition • instance 
magnitude 
  ^ magnitude 
Number method definition • instance 
gm 
  ^ Weight new initialize: self 
Weight method definition • instance 
initialize: aNumber 
  magnitude := aNumber 
Weight method definition • instance 
printString 
  ^ magnitude printString , 'gm' 
Weight method definition • instance 
+ aWeight 
  ^ (self magnitude + aWeight magnitude) gm 
Weight method definition • instance 
< aWeight 
  ^ (self magnitude < aWeight magnitude)