nil or #nil?

Michael Donegan invader at oak.zilker.net
Sun Aug 23 15:11:00 UTC 1998


I'm playing with porting T-Gen.
In doing so I ran into the following interesting problem.
The parse tables in T-Gen are initialized using a construct like so (you
can run this, if you like, and follow along):

Table _ #( (-1 -1 ) 2 3 nil).
Table inspect

Apparently, the Smalltalk that T-Gen was written for (?) treats nil as a
special case. But for Squeak, (Table at: 4) == #nil (not nil). This was
pretty tricky since it looks like a nil when you print it out. If you
inspect it, however, you see that it is an array with three elements.

I'm thinking that this is so confusing that Squeak should adopt the
behavior of recognizing 'nil' as a special case inside of a constant array.

Any thoughts?

        mkd





More information about the Squeak-dev mailing list