Shouldn't ifEmpty return self?
andreas.raab at gmx.de
Mon Jun 12 23:08:19 UTC 2006
Klaus D. Witzel wrote:
> On Tue, 13 Jun 2006 00:13:18 +0200, Andreas Raab wrote:
>> Klaus D. Witzel wrote:
>>> Ah. And I was believing the description in True>>#ifTrue:
>>> ifTrue: alternativeBlock
>>> "Answer the value of alternativeBlock. Execution does not actually
>>> reach here because the expression is compiled in-line."
>>> ^alternativeBlock value
>>> So the bug is in the documentation? This is not an easy one: who
>>> would doubt the implementation of such an essential behavior?
>> I don't see a bug in either the implementation nor the documentation
>> of ifTrue:/ifFalse:. You need to look at False>>ifTrue: if you want to
>> understand the described behavior of ifEmpty:
> No. I do not look into the implementation of #ifFalse: for finding out
> if the implemntaion of #ifTrue: matches its own specification ;-) Nobody
> does :-D
Geesh. Try to do some reading next time before you write something. I
was talking about ifTrue: (not ifFalse:) since you were questioning the
*implementation* of True>>ifTrue: (which is obviously correct) in the
context of the ifEmpty: discussion which is just as obviously determined
by False>>ifTrue:. But if you're really into splitting hairs, then go
change "Execution does not actually reach here" into "Execution does not
usually reach here" which is arguably more accurate.
More information about the Squeak-dev