doIfNotNil: -- let's bake the other half

Dan Ingalls Dan.Ingalls at disney.com
Mon Oct 16 03:57:50 UTC 2000


Joshua Channing Gargus <schwa at cc.gatech.edu> asked...
>What is the difference between doIfNotNil: and ifNotNil:?

... and then answered his own question.

Since it's on the table, though, I want to say that
I actually don't like the name doIfNotNil, in light of a long
discussion several years ago that wound up condemning do:
as defined by singleton objects (with which I basically agree).
We wound up renaming that message to be 'in:' which is so
general as to be meaningless, and nobody uses it as a result.

So when it came to name this method, I couldn't hack 'ifNotNilIn:',
and fell back on this 'do' flavor.

Since the end result is <someBlock> value: <some receiver>, 
the patterns should probably be

	expr beValueFor: block
	expr ifNotNilBeValueFor: block
or
	expr evaluate: block
	expr ifNotNilEvaluate: block

Has this all been hashed around in other Smalltalks with some reaonable outcome?

	- Dan






More information about the Squeak-dev mailing list