[squeak-dev] SmalltalkImage semi-self-references

David T. Lewis lewis at mail.msen.com
Sat Jul 20 15:50:41 UTC 2013


On Sat, Jul 20, 2013 at 04:03:47PM +0100, Frank Shearar wrote:
> Look at method sources containing "SmalltalkImage current". Filter the
> list to only show methods for the SmalltalkImage class. There are
> 23-odd methods in SmalltalkImage, on the instance side, that send
> "SmalltalkImage current".
> 
> Why? Why not just replace all these sends with "self"? Under what
> circumstances might we even have SmalltalkImage current ~= self?
> (Never mind that "Smalltalk current" is hardcoded to return Smalltalk,
> anyway.)
> 
> I suggest we just use "self" in these messages. Thoughts? Comments?
> 
> frank

If you can convince yourself that the concept of a "current" image (as
opposed to what???) makes sense, then it also makes sense to consistently
refer to that singleton as "SmalltalkImage current".

To me, the term "current" suggests something that might change over time,
so that it might turn into a different thing if I wait around for a day
or so. That does not make much sense to me, but if it did make sense,
then "SmalltalkImage current" would be the right way to refer to it.

Dave



More information about the Squeak-dev mailing list