[ANSI-Smalltalk] Protocol extensions - Object
Paolo Bonzini
bonzini at gnu.org
Mon Sep 8 08:21:32 BST 2008
Richard A. O'Keefe wrote:
> On 8 Sep 2008, at 6:04 pm, Paolo Bonzini wrote:
>> Squeak overloads #perform: for a Message argument, see
>>
>> http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-September/120697.html
>>
>>
>> for an example. What do you think about it?
>
> I think I can't find it in Squeak 3.10.
I don't know -- the page I cited has
RadioWrapper class >> doesNotUnderstand: aMessage
"Handle messages that are not implemented on this wrapper by
passing them to #subject"
^self subject class perform: aMessage.
I looked in my notes and found that Dolphin was the one which originally
introduced this extension.
> What Squeak _does_ have is Message sentTo: anObject,
> so
> (Message selector: #+ argument: 2) sentTo: 1
>
> works. Adding Message>>sentTo: does not raise that question.
> It does seem odd to have Messages with no direct way to send
> them, so adding #sentTo: would seem to make sense.
Yes. However, I'm reluctant on the naming. Why #sentTo: and not
#sendTo:? I've almost never seen a method named as a past participle,
and when I did, it returned a variation of the receiver, for example
#reversed or #sorted.
Paolo
More information about the ANSI-Smalltalk
mailing list