These are not really nested if, but rather a kind of caseOf:
implemented with elseif.
It's not to say that the style is ideal...
I did not read the code, and don't know what a range is, nor if it has
subclass specializations.
If so, maybe some actions could simply be dispatched to range.

Nicolas

Le 23 avril 2012 10:58, Esteban Lorenzano <[email protected]> a écrit :
> he... is not related with the error, but... did you see this method?
>
> guessTypeOf: aNumber
>        | range |
>        self configureSelectorsOnly.
>        recurseCount > 10 ifTrue: [ ^ nil ].
>        recurseCount := recurseCount + 1.
>        range := ranges at: aNumber.
>        ^ range isSelf
>                ifTrue: [ theClass ]
>                ifFalse:
>                        [ range isSuper
>                                ifTrue: [ theClass superclass ]
>                                ifFalse:
>                                        [ range isConstant
>                                                ifTrue: [ range asType ]
>                                                ifFalse:
>                                                        [ range isArgument
>                                                                ifTrue: [ self 
> guessArgument: range ]
>                                                                ifFalse:
>                                                                        [ 
> range isTemporaryVariable
>                                                                               
>  ifTrue: [ self guessTempVarClass: range ]
>                                                                               
>  ifFalse:
>                                                                               
>          [ range isInstanceVariable
>                                                                               
>                  ifTrue: [ self guessInstVarClass: range ]
>                                                                               
>                  ifFalse:
>                                                                               
>                          [ range isClassVariable
>                                                                               
>                                  ifTrue: [ self guessClassVarClass: range ]
>                                                                               
>                                  ifFalse: [ range isGlobal ifTrue: [ self 
> guessGlobal: aNumber ] ] ] ] ] ] ] ]
>
>
> when I was younger, at informatics school, they told me that "3 nested ifs 
> means bad design, with no doubt"... what about 7?
>
>
> On Apr 23, 2012, at 10:30 AM, Esteban Lorenzano wrote:
>
>> yes, I can reproduce this one... taking care of it now :)
>>
>> On Apr 23, 2012, at 10:11 AM, Stéphane Ducasse wrote:
>>
>>> Note that the bug shows up if you edit the code in the result of the 
>>> implementors.
>>> Esteban can you reproduce the bug?
>>>
>>> Stef
>>>
>>> On Apr 23, 2012, at 9:18 AM, Stéphane Ducasse wrote:
>>>
>>>> Hi
>>>>
>>>> I get a bug with OCompletion/Ecompletion
>>>>
>>>> TextEditor>>changeEmphasis
>>>>
>>>> try to type
>>>>
>>>>     menuList nextPut:
>>>>
>>>> and you get a bug.
>>>>
>>>> Now in addition I do not understand what I see in the debugger:
>>>>
>>>> As you see model returns a debugger and the debugger title show 
>>>> FlatMessageListBrowser
>>>>
>>>> Stef
>>>>
>>>>
>>>>
>>>> <Screen Shot 2012-04-23 at 9.08.45 AM.pdf>
>>>
>>>
>>
>
>

Reply via email to