What to believe?
Bert Freudenberg
bert at freudenbergs.de
Wed Jun 27 06:54:39 UTC 2007
On Jun 26, 2007, at 23:59 , Blake wrote:
> However, is the question not really "What do the booleans return
> from an if* statement if the conditional is not met"? In which
> case, the answer is "nil".
>
> I guess if we're talking portability though, it might be a valid
> question. I'm not sure the Smalltalk spec mandates that instances
> of True and False must return nil.
"ifTrue: aBlock" is short-hand for "ifTrue: trueBlock ifFalse: []".
The value of an empty block is nil by definition. That's why True and
False must return nil in #ifFalse: and #ifTrue:, respectively.
- Bert -
More information about the Squeak-dev
mailing list
|