![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Note that Smalltalk treats +
,
-
, *
, /
, sqrt
, and raisedTo:
as
methods that happen to appear in messages sent to numbers. Accordingly, to
understand arithmetic expressions, you must forget about the
precedence and association conventions of ordinary
arithmetic. Instead, you must remember that unary methods have precedence
higher than that of binary methods, and binary methods have precedence
higher than that of keyword methods. You must also remember that methods
of the same type are sent in left-to-right order.