[FIX] nil and #nil and a fix for RxParser

Avi Bryant avi.bryant at gmail.com
Tue Dec 7 11:19:30 UTC 2004


On Tue, 07 Dec 2004 01:08:41 -0800, Andrew P. Black <black at cs.pdx.edu> wrote:
> Did the meaning of
> 
>         array  :=  #(12 nil foo)
> 
> change at some point?   array last is of course #foo.  array first is
> 1. array third is now nil.  Was array third #nil at some point in the
> past?
> 
> I'm asking because  RxParser class >>
> test:with:expect:withSubexpressions: is driven off a table of array
> literals.  It has a test "subxpr ~= #nil" that now has to be modified
> to read "subxpr ~= nil" to get the tests to run.
> 
> I'm sure that Vassilli would have had this right at some time in the
> past, maybe in "Some Other Smalltalk".  Is this an incompatibility
> with VisualWorks?

I could be misremembering, but I think what happened is this:

1. In VisualWorks, (#(12 nil foo) at: 2) == nil.
2. That's the way the tests were written for Vassili's version.
3. In Squeak, (#(12 nil foo) at: 2) == #nil.
4. When I ported the RxParser to Squeak, I changed those tests to make
them pass.
5. Having had to do this for several packages ported back and forth, I
posted to the list about the issue and included a changeset that
modified Squeak's behavior.
6. Surprisingly (and without proper review, unfortunately, see recent
comments from Andreas), this change got included into the base.
7. The regex package hasn't been updated since.

As was mentioned in the discussion at the time, ANSI dictates the
current behavior (nil, not #nil), and I'm pretty sure Squeak was the
only Smalltalk that did it the other way.

Avi



More information about the Squeak-dev mailing list