nil or #nil? (What the ANSI Standard says)

Allen Wirfs-Brock Allen_Wirfs-Brock at Instantiations.com
Tue Aug 25 20:31:32 UTC 1998


At 03:13 PM 8/25/98 -0400, Jarvis, Robert P. wrote:
....
>The equivalent in Squeak,
>
>	#(fo ob ar)
>
>appears not to be allowed in ANSI Smalltalk (or more likely
>I just don't understand which literal form fo, ob, and ar would
>take).
>

The meaning of identifies other than 'true', 'false', and 'nil' in literal
arrays is explicitly specified as undefined. In the context of the standard
"undefined" means:

"If a feature is denoted undefined a conforming implementation may accept a
program using the feature, but must document that it does so. A conforming
implementation is not required to accept an undefined feature. A program
that is dependent upon the use of an undefined feature does not conform to
the standard."

In other words, an implementation may define an "undefined feature" to mean
anything it wants or may flag its use as an error. Undefined features
generally exist to provide a compatibility hook with non-standardized
features in existing implementations or to provide a hook that allows
future language extensions. If you program uses such an undefined feature
the program does not conform to the standard and hence may not be portable
to other standard conforming implementations of the language.

In this case it means that an implementation could choose to define the
occurrence of such identifiers to mean what it does in Smalltalk-80 or it
could define such an occurrence to mean something else, or it can treat it
as an error.

Allen_Wirfs-Brock at Instantiations.com





More information about the Squeak-dev mailing list