I think, at that moment when you need to write this code, I will ask myself why I have to write so many conditions in order to proceed to the next step in my algorithm. Maybe it's time to think what is wrong with the model? Especially if you think that the semantics of message search is actually a case argument:
selector = selector1 ifTrue: [ invoke method1 ] ifFalse: [ selector= selector2 ifTrue: [ invoke method2 ] ifFalse: [...] ]]].
Thus, you should try to turn this into your advantage - use the instruction of the VM operator instead of writing your own.
Using a simple principle: don't ask (object isSomething ifTrue: [self doSomething]), but say (object doSomething), you can avoid having many branches in your code. Of course, sometimes this is not applicable and highly dependent on the situation, but I often prefer to have additional sending messages, rather than another branch in the code.
source share