On 30 Jun 2015, at 1:21 , abdelghani ALIDRA <alidrandco@yahoo.fr> wrote:

Hi guys,

what is the best way to express the following :
return (something aMsg) if it is not nil, return somethingElse elsewhere

I could stil write:

something aMsg
    ifNil:[^ something aMsg]
    ifNotNil:[^aNotherResult]

but it sounds a little bit weird

Regards.

Abdelghani

Assuming there's a bug in your code, and not the stated intent, the normal way is:

^something aMsg ifNil: [anotherResult]

Cheers,
Henry