reserved words?

Raymond raymondasselin at sympatico.ca
Mon Nov 4 23:03:55 UTC 2002


Le 2002/11/04 à 06:03, Boris Gaertner <Boris.Gaertner at gmx.net> écrivait: 

>
>Albert Wagner <alwagner at tcac.net> asked:
>> 
>> >does Smalltalk have any reserved words
>
>Michael Vanier <mvanier at cs.caltech.edu> wrote:
>> 
>> self, super, nil, true, and false come to mind.  I'm not sure if they are
>> technically reserved.  They are called "pseudovariables" in ST jargon.
>They are write-protected. Also, you cannot define them as temporary
>variables (e.g.  | self |). (Squeak tells you that these names are already defined)
>
>> "true" and "false" are also pseudovariables, but they are singleton
>> instances of class True and False respectively.  Similarly, nil is the
>> singleton instance of class UndefinedObject.  So that just leaves self and
>> super ;-)
>There is one additional pseudovariable:  thisContext.
>It is hardly ever used for application development, but it
>comes into play when things like exception handling or
>debugging are programmed. This is definitely something
>for our bright stars.
>
>You should also note that there are a few method names that
>are given special treatment. These are
>
>  ifTrue: ifFalse: ifTrue:ifFalse: ifFalse:ifTrue:
> and: or:
> whileFalse: whileTrue: whileFalse whileTrue
> to:do: to:by:do:
> caseOf: caseOf:otherwise:
> ifNil: ifNotNil:  ifNil:ifNotNil: ifNotNil:ifNil:
>
>(All these are mentioned in MethodNode class >> initialize)
>
>These messages are usually not sent, but inlined by the compiler. To
>avoid strange errors, you should consider these message names as reserved.
>
>
>Greetings, Boris


In this regard what is Œyourself¹ ....?



More information about the Squeak-dev mailing list