On 25 June 2013 11:09, Camille Teruel <[email protected]> wrote: > > On 25 juin 2013, at 10:28, Esteban Lorenzano wrote: > > > On Jun 24, 2013, at 6:59 PM, Camillo Bruni <[email protected]> wrote: > > > On 2013-06-24, at 18:55, Stéphane Ducasse <[email protected]> wrote: > > > the isBlah is not optimal now it is just there and we cannot rewrite > everything. > > I still think that is: is a nice way to kill some of the isPlague in Object. > > > I still don't see what you solve, and the idea to use symbols for #is: is > also > > wrong, for me that's going back to string-based programming. > > > well, that's basically my argument agains #is: > IMO is also an important performance issue in many cases, because is > replacing a simple send with a string comparison and that can provoke > slowdowns in some places (no idea where, this is just theoretical :)... > Of course, as "pharo designers" we should be careful on not overpopulate > Object with isBlah methods... but sometimes they are needed :) > > > +1. > Indeed, sometimes they are needed. You can't replace every isXXX send with a > new visitor or dispatching by adding more and more extension methods all > over the place (including Object BTW). > Yet a fair amount of these methods can be removed. > I think that a lot of these methods exist only because people think that > isKindOf:/isMemberOf: are always evil, and its not true. > There is at least three cases were I don't feel guilty using > isKindOf:/isMemberOf: : > - In unit tests > - In #= methods > - When I really want to ensure that an object is an instance of a specific > class (see MethodContext>>#privRefreshWith: for example). This poor's man > type checking can be replace with typed slots (that end up using > isKindOf/isMemberOf: anyway). > If we agree on that we can remove many #isXXX methods. > Then there is some #isXXX methods that do not belong to Object (ex: > #isTransferable belongs to Morph) and others that can be removed just by > refactoring senders. > We can also move some of them to extension methods, that doesn't solve the > problem but it's a better packaging. > Anyway I don't want to rely on #is: method because it conflates a lot of > selectors into one. > yes. it is. so what is the problem?
Are you sure you understand the purpose of #is: method? its purpose is for cases when you realy realy very very badly want to add own isPlague to Object protocol. In that case, you should use 'is: #plague' because no new isXXXX methods should be added anymore. The feast is over, and you should use #is: method. (or think how to not use isXXX pattern at all). > > TL;DR: I agree with Camillo :) > > > anyway, this topic has been discussed with enough hot air so far and no > progress, > > which means it is absolutely not important. there are more urgent things to > done... > -- Best regards, Igor Stasenko.
