On 25 January 2012 21:48, Garret Raziel <[email protected]> wrote:
> I have another question, too short to create another thread. What happens if
> some object has method a: and b: AND a:b:? For example, SmallInt has method
> raisedTo:modulo:, but what will happen, if I define methods
> SmallInt>>raisedTo: and SmallIt>>modulo: and then execute "5 raisedTo: 6
> modulo: 3"? Will it use "raisedTo:modulo:" method or will it use "raisedTo:"
> method and then send "modulo:" method to the result?
>
> Jan

The message names are greedy, so in your example "5 raisedTo: 6
modulo: 3" will send the #raisedTo:modulo: message to 5 with arguments
6 and 3. If you wanted to send #raisedTo: and then #modulo: you'd have
to use parentheses: "(5 raisedTo: 6) modulo: 3".

frank

Reply via email to