Category:Smalltalk: Difference between revisions

Line 247:
Message sends are dynamically resolved, by letting the receiver of the message determine the method (aka code to run). The message consist of a selector (= name of the message) and optional arguments. The message syntax as:
<lang smalltalk>receiver selector</lang>
a unary message, without arguments. In a C-like language, this would be written as "receiver.selector()".
 
<lang smalltalk>receiver part1: arg1 part2: arg2 ... partN: argN</lang>
a keyword message; the selector consists of the concatenation of the keyword parts: 'part1:part2:...partN:'. In a C-like language (assuming that colons are allowed in an identifier), this would be written as "receiver.part1:part2:...partN:(arg1, arg2,... argN)".
 
<lang smalltalk>receiver op arg</lang>
Anonymous user