(#(nil) at: 1) ~~ nil

Dave Newman tinman at ntsource.com
Mon Feb 8 16:29:30 UTC 1999

Dan Ingalls writes:
> >In furthering my understanding of Squeak I came across the fact
> >that
> >
> >( #( nil ) at: 1 ) ~~ nil.
> >
> >evaluates to true.
> In short, yes.  It is the way Squeak is supposed to work, and the way all=
>  Smalltalk-80s worked originally, following the simple rule that identifiers=
>  in a literal array get turned into symbols -- period.
> You may want to stop here  (8-)...
> Some people expect, and some Smalltalks provide, special treatment for nil,=
>  or for nil, false and true.  There was a loooooo......ooooooong discussion=
>  about this on the SqueakList beginning 8/23 of last year under the heading,=
>  "nil or #nil?".  Everyone has good reasons for their differing positions on=
>  this topic.


Thanks for the short (and long) explanations. I'm okay with keeping the
status quo. I encountered this while porting T-Gen. It uses some large,
literal arrays with lots of nils sprinkled about. I've already found a
work-around for this though. Nothing a little recursive search and
replace couldn't fix after the literal array is filedIn. <grin>


More information about the Squeak-dev mailing list