[Q] perform:orSendTo:

germanmorales at delta-sys.com germanmorales at delta-sys.com
Sun Jun 23 10:37:03 UTC 2002


It seems that on Sat, 22 Jun 2002 17:33:53 -0400 (EDT) you
wrote:
> On Sat, 22 Jun 2002 14:11:26 -0700
> German wrote:
> >The problem seems to be that Object>>perform:orSendTo:
> >doesn't do what its selector says, but just sends the
> >message to the other possible target.
> ><snip>
> >Mi questions are:
> >Why this is not the current implementation?
> >It's just a bug or there's something else behind?
> >Should I send a change set with such a fix? ;-)
> 
> German,
> 
> There are other classes implementing this method in a
> manner similar to the one you suggest. My guess that
> Object was left as simple as possible (#respondsTo: is
> not cheap, nor does it win a lot of points for style) in
> the hopes that the programmer would spot the problem
> quickly and fix it somewhere else (whatever you do in
> Object for this will not satisfy everyone).
> 
> Cheers,
> Bob

Thanks for your answer. But it didn't make me happy.

I think that a method should do what it says will do.
Or at least should be a comment saying that I must fix it.

When I read "perform:orSendTo:", I understand:
"perform this on you, but if you cant, then send it to this
other Object". And this is clearly not what it does.

Should I read it as "perform this on you or this other
Object, I don't care on which" ???

And why it's implemented:
   otherObject perform: selector
and not:
   self perform: selector
???

Thanks in advance

German



More information about the Squeak-dev mailing list