True>>ifFalse: and False>>ifTrue: returning nil
Brian T Rice
water at tunes.org
Wed Sep 3 23:32:07 UTC 2003
>From the comment:
"Since the condition is true, the value is the true alternative, which is
nil. Execution does not actually reach here because the expression is
compiled in-line."
I think it's been debated here before, but the gist is that the
alternative to a block result is "nothing" or "no-object", hence nil.
On Wed, 3 Sep 2003, Julian Fitzell wrote:
> Does anyone know why True>>ifFalse: returns nil instead of self like,
> say, ProtoObject>>ifNil: does? My understanding was that the #ifFoo:
> methods would all evaluate the parameter if the assertion was correct
> and return self otherwise. Is there a reason for this or is it a bug?
>
> Julian
>
>
--
Brian T. Rice
LOGOS Research and Development
http://tunes.org/~water/
More information about the Squeak-dev
mailing list
|