> Thanks for one more insight, by showing me that sending message/calling a method is a binary operation
The other way around.
A "binary message" is specifically the message of binary operators. Smalltalk also has unary messages (named messages with no parameters), and keyword messages (non-binary messages with parameters).
Its precedence rules are unary > binary > keyword, and left to right.
So
foo bar - baz / qux quux: corge
binds as
(((foo bar) - baz) / qux) qux: quux
You can still get into sticky situations, mostly thanks to the cascading operator ";":
a b; c
sends the message following ";" to the receiver of the message preceding ";". So here it's equivalent to
a b.
a c
now consider:
foo + bar qux; quux
This is equivalent to
foo + bar qux.
foo quux
Because the message which precedes the ";" is actually "+", whose receiver is "foo":
The other way around.
A "binary message" is specifically the message of binary operators. Smalltalk also has unary messages (named messages with no parameters), and keyword messages (non-binary messages with parameters).
Its precedence rules are unary > binary > keyword, and left to right.
So
binds as You can still get into sticky situations, mostly thanks to the cascading operator ";": sends the message following ";" to the receiver of the message preceding ";". So here it's equivalent to now consider: This is equivalent to Because the message which precedes the ";" is actually "+", whose receiver is "foo":