Hi,

I wanted to write a method that:
- if (a = b) checks other conditions that are specified in the ifTrue block and 
return this (boolean) value
- returns false if (a!=b) 

So I wrote:
myMethod
        ^ (a=b) ifTrue: [ aBlockCheckingConditions].

However, when (a!=b) the method returns nil (since false ifTrue: [] returns 
nil). So do you have an idea how I can do to express that or should I 
mandatorily wrote also an ifFalse:?

The problem comes certainly because we don’t know that the ifTrueBlock will 
return a boolean.

If you have prettier ideas, I am interested in.

Anne

Reply via email to