Class name defines atomic text in PCE. That is, each instance of this class represents a unique text or, in other words, two name objects represent the same text if-and-only-if they have the same object reference (hence are the same objects).
Names, like atoms in Prolog and keywords in Lisp, are used as
identifiers: class names, method names, etc. The uniqueness
feature guarantees fast mapping from names to the named objects (see
class hash_table).
PCE does not garbage collect names. Names should thus only be used for constants and not for handling text that is continuously modified. Class string is designed for handling temporary and changing textual information.
->syntax
and should only be used at boot time to solve specific host-language
binding problems.->initialise.<-lookup
fails (i.e. if this is a new name). This
method copies the text and then invokes
name->register
on itself to insert itself into the symbol table.<-lookupThe second argument is the word-separator character. All occurrences of the current word-separator will be mapped on this character.
This method is exclusively to support pce->syntax.
<-self.->register
and name<-lookup
form a pair that guarantee the uniqueness of name
objects. If a string (char_array) is to be converted into a name
object, the PCE object
creation system will first call
name<-lookup,
which attempts a lookup in the name-table. On failure, the object
creation system will call name->initialise
to create a name. name->initialise
calls name->register
which registers the new name in the name-table.<-modify’for
details.