Symbol name [text string]
Adds a symbol definition to the program. The name of the symbol must not include a $ character. To use the symbol, the user adds a $ to the start of the symbol name. For example,
O> symbol greetings Hullo world O> print $greetings O> Hullo world
The terminal line is parsed and any set of characters representing a current symbol is replaced by the symbol expansion. Symbols are particularly useful with macros to define which molecule or map to work with, for example. To remove a symbol, run the command with prompting and hit a [CR] instead of a new text string.
If symbols are part of a text string, the name of the symbol must be enclosed in braces, like in the following example, which is the content of a macro to set up parameter blocks to deal with nucleic acids:
db_set_data ${mol}_molecule_ca ; P db_set_data ${mol}_molecule_ca_mxdst ; 8.3
Certain symbols are predefined by O, for example ${user}, ${host} and ${domain}. If the $ODAT environmental variable is defined when the program starts, the first path of it is copied into the symbol ${odat}. When using the $ command, symbols are scanned by O before the line is received by the operating system, so that
O > $ ls ${odat}
would give you the directory listing of the public O directory.
A few very useful symbols are created and updated as you are picking
residues and atoms: ${.id_m}
contains the name of the last picked
molecule, ${.id_r}
and ${.id_a}
the names of the last picked
residue and atom, respectively. The ${.id_z}
symbol contains the
names of the last two residues that were picked, if these were from the
same molecule.
If a symbol is not found in the symbol table, ``brace'' form symbols are eaten by the parser and deleted from input (like in the UNIX shell). Contrary, the ``dollar'' form of the symbol is not eaten, since it could be the name of a residue, for example. The brace form of symbols is the most unambiguous and preferred notation for symbol references.
Symbols are saved in the .SYMBOLS datablock, but you can not change symbols by manipulating this datablock.