![]() |
![]() |
![]() |
![]() |
![]() |
|
Whenever a Smalltalk expression contains multiple methods of mixed types, a few simple rules determine how the expression is to be evaluated:
Thus, unary messages are said to have the highest precedence; keyword messages have the lowest precedence; and binary messages have precedence in between.
Thus, Transcript show: 1746 printString produces the following event
sequence:
printString message is sent to 1746.
Integer instance, 1746, answers a String instance,
'1746'.
show: message is sent to Transcript, with
'1746' as the argument.
show: method causes a character sequence, 1746, to be
displayed in the transcript.