[ANSI-Smalltalk] Protocol extensions - Object

Andres Valloud andres.valloud at gmail.com
Thu Sep 25 10:27:03 BST 2008


For example, in VW it's #reverse, and I (personally) find it a bit off
that it does not read as #reversed --- particularly because the answer
is a copy.  If the original object was modified, then I'd say #reverse
is more appropriate.

Andres.


On Mon, Sep 8, 2008 at 12:21 AM, Paolo Bonzini <bonzini at gnu.org> wrote:
> 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
>
> _______________________________________________
> ANSI-Smalltalk mailing list
> ANSI-Smalltalk at lists.openskills.org
> http://lists.openskills.org/cgi-bin/mailman/listinfo/ansi-smalltalk
>



More information about the ANSI-Smalltalk mailing list