Home Segments Index Top Previous Next

118: Mainline

Suppose, for example, that you want to define covertToCaloriesWith:, a keyword method called when a covertToCaloriesWith: message is sent to an integer with an argument:

Workspace
Transcript show: (194 convertToCaloriesWith: 4) printString 
Transcript 
776 

To define such a method, you must learn how to incorporate parameters into method definitions.