••• Unprocessable paragraph: \start
Home Segments Index Top Previous Next

611: Mainline

\slidefont

Bringing everything together, the contents of the weight.cls file describing the Weight class and all the associated methods has the following contents:

••• Unprocessable paragraph: \begincode \par C:\Phw\Onto\Smalltalk\exchange.tex •••

Magnitude subclass: #Weight instanceVariableNames: 'magnitude ' classVariableNames: ” poolDictionaries: ” !

!Weight class methods ! !

!Weight methods ! + aWeight ^ (self magnitude + aWeight magnitude) gm! < aWeight ^ (self magnitude < aWeight magnitude)!

initialize: aNumber magnitude := aNumber!

magnitude ^ magnitude! printOn: aStream aStream nextPutAll: magnitude asString , 'gm'! ! C:\Phw\Onto\Smalltalk\exchange.tex •••