]>
Symbols are one of the basic types manipulated by Axiom. The Symbol domain provides ways to create symbols of many varieties.
The simplest way to create a symbol is to ``single quote'' an identifier.
This gives the symbol even if x has been assigned a value. If x has not been assigned a value, then it is possible to omit the quote.
Declarations must be used when working with symbols, because otherwise the interpreter tries to place values in a more specialized type Variable.
The normal way of entering polynomials uses this fact.
Another convenient way to create symbols is to convert a string. This is useful when the name is to be constructed by a program.
Sometimes it is necessary to generate new unique symbols, for example, to name constants of integration. The expression new() generates a symbol starting with %.
Successive calls to newnewSymbol produce different symbols.
The expression new("s") produces a symbol starting with %s.
A symbol can be adorned in various ways. The most basic thing is applying a symbol to a list of subscripts.
Somewhat less pretty is to attach subscripts, superscripts or arguments.
It is possible to test whether a symbol has scripts using the scripted?scripted?Symbol test.
If a symbol is not scripted, then it may be converted to a string.
The basic parts can always be extracted using the namenameSymbol and scriptsscriptsSymbol operations.
The most general form is obtained using the scriptscriptSymbol operation. This operation takes an argument which is a list containing, in this order, lists of subscripts, superscripts, presuperscripts, presubscripts and arguments to a symbol.
If trailing lists of scripts are omitted, they are assumed to be empty.