![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Note that a class definition, in contrast to a method definition, is expressed as a message sent to a class. The following diagram explains:
*-- The Object class is the receiver of the message | | *-- The first keyword in the message is subclass: | | | | *-- The subclass to be defined is named Vegetable; | | | the # mark is explained in Segmentmissing reference v v v Object subclass: #Vegetable *-- Second keyword *--------*-- Single-quotation marks delimit | | | instance variables | | *--------------------* v v v instanceVariableNames: 'fCalories cCalories pCalories' classVariableNames: '' <--*------- Other keywords and arguments, | explained in Segmentmissing reference poolDictionaries: '' <--* and Segmentmissing reference