June 30, 2015
11:27 a.m.
all is valid and a matter of style. You can also do this: ^ something aMsg ifNotNil:[ aNotherResult ] ifNil:[ something aMsg ] or this: something aMsg ifNil:[ ^ something aMsg ]. ^ aNotherResult cheers, Esteban
On 30 Jun 2015, at 13: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