Navigation:  Tutorials > Beginners Guide to Smalltalk > Classes and Methods > Methods >

Method header

Previous pageReturn to chapter overviewNext page

The next important thing is the first line, which forms the method header. This defines the selector for the method (<=) and any parameters that the method takes. Since #<= is a binary message we expect it to take a single parameter which, in this case, we have called anArithmeticValue.

Tip: it is very common in Smalltalk to describe the method parameters using names like anArithmeticValue, aString, anInteger etc. This is not enforced; it is just a way of helping the reader determine what sort of parameter a particular method expects.

Once the parameters have been named at the beginning of the method they can be used like any variable in the body text. In fact, that's not quite true because you're not allowed to assign to them; they are read only. For this reason they are sometimes called pseudo-variables.