[NIT] Pretty pretting #ifFalse:ifTrue:

Tim Rowledge tim at sumeru.stanford.edu
Mon Nov 19 06:33:04 UTC 2001


Bijan Parsia <bparsia at email.unc.edu> is widely believed to have written:

> Inlining strikes again!
> 
> Turns out that pretty printing rewrites #ifFalse:ifTrue: to
> #ifTrue:ifFalse:
Actually it seems to be worse than that; if you have something like

	a _ bool
		ifTrue:[self fribble]
		ifFalse:[nil]
it will usually get turned into
	a _ bool ifTrue:[self fribble]
with the other clause getting dropped.

This is acceptable, indeed an optimisation in many cases, but not for
example in a loop where you need 'a' to _reset_ to nil part way through
an enumeration.

tim

-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
No program done by an undergrad will work after she graduates.





More information about the Squeak-dev mailing list