On 25 June 2013 11:09, Camille Teruel <camille.teruel@gmail.com> wrote:On 25 juin 2013, at 10:28, Esteban Lorenzano wrote:On Jun 24, 2013, at 6:59 PM, Camillo Bruni <camillobruni@gmail.com> wrote:On 2013-06-24, at 18:55, St�phane Ducasse <stephane.ducasse@inria.fr> wrote:the isBlah is not optimal now it is just there and we cannot rewriteeverything.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: isalsowrong, 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 isreplacing a simple send with a string comparison and that can provokeslowdowns in some places (no idea where, this is just theoretical :)...Of course, as "pharo designers" we should be careful on not overpopulateObject with isBlah methods... but sometimes they are needed :)+1.Indeed, sometimes they are needed. You can't replace every isXXX send with anew visitor or dispatching by adding more and more extension methods allover 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 thatisKindOf:/isMemberOf: are always evil, and its not true.There is at least three cases were I don't feel guilty usingisKindOf:/isMemberOf: :- In unit tests- In #= methods- When I really want to ensure that an object is an instance of a specificclass (see MethodContext>>#privRefreshWith: for example). This poor's mantype checking can be replace with typed slots (that end up usingisKindOf/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 byrefactoring senders.We can also move some of them to extension methods, that doesn't solve theproblem but it's a better packaging.Anyway I don't want to rely on #is: method because it conflates a lot ofselectors 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 noprogress,which means it is absolutely not important. there are more urgent things todone...
--
Best regards,
Igor Stasenko.