About Smalltalk at: .... ifAbsent:/present:

Colin Putney cputney at wiresong.ca
Tue Nov 30 13:50:38 UTC 2004


Andreas Raab wrote:

> I like it but it's ambigious too if for any reason the value of Foo 
> understands the message. The point is that the #ifPresent: message 
> really is meta in the sense that it ought to be sent to the variable Foo 
> instead of the value Foo.

Aren't you the one who keeps saying that Smalltalk doesn't have 
variables, just names that refer to objects? :-)

Given the limitation that we can't send a message to the variable (the 
binding, I guess) without changing the language, I still think this is a 
reasonable solution:

* it provides a consistent idiom for expressing a weak dependency
* the default implementation can handle the class-loaded-or-absent case
* other objects can override it to manage their own "presence."

That seems consistent with the way other parts of Smalltalk work, and 
it's a distinct improvement over the ad-hoc stuff we've all been doing.

Colin



More information about the Squeak-dev mailing list