Lisp Variables



next up previous contents index
Next: Property Lists Up: Concepts in REDUCE Previous: Notation

Lisp Variables

  There are two operating modes in reduce: algebraic and symbolic. The first is the normal mode for REDUCE in which ordinary algebraic expressions may be entered. The symbolic mode,           which accepts RLISP syntax, is an interface to the lower level lisp system, and allows the entry of more primitive operations. The setting of the control variable !*mode determines which mode is currently active. The commands lisp or symbolicgif by themselves change the system to symbolic mode; if they precede a command on the same line, they cause only that command to evaluated in symbolic mode. The command algebraic acts similarly to change to algebraic mode.

Nearly all of the user interaction with REDTEN involves the usual REDUCE algebraic variables. However, some REDTEN control variables are defined in the underlying lisp system, and require care in setting or modifying. Most of these are default names for objects created by various functions, and a few are lists. Lisp lists are also used as arguments to some REDTEN functions and are used because they are the most convenient way to represent and input certain parameters and properties of tensors, such as the index structure or symmetries. A list has the form of a single quote mark ', followed by a parenthesized list of elements separated by spaces (not commas):  

'(t h i s i s a l i s t).
A special case is the empty list, which is represented as '(). A special lisp symbol, nil,   is used to represent the empty list and it is the usual way the lisp printer displays empty lists.

The REDUCE parser, when it encounters a quote mark on the first argument to a function, automatically parses the function call in symbolic mode, so that the following are equivalentgif:

% this is a crummey example!
#: val := '(q w e);

(q w e)

#: lisp (val := '(q w e));

(q w e)
The brackets enclosing the command following the lisp command ensure that the whole command line is treated in symbolic mode.

The variable val, in the above example, is a ``lisp variable'', and its lisp value can be examined with  

#: lisp val;

(q w e)

#: val;

val
and observe that the algebraic value of val is not affected. In this document, lisp variables used by REDTEN will be distinguished from algebraic variables by prepending lisp: to the variable name, so that, for example, lisp:coords!* is the lisp variable containing a list of the current coordinates.    

In a similar manner, there are a number of functions that can only be accessed while in symbolic mode, these are not required for the ordinary operation of the system, but are occasionally of use. The property functions described below are of this type. These will also be indicated by prepending ``lisp:'' to the name, and it is understood that to use these functions, the command line should begin with the mode changing commands lisp or symbolic. Throughout this document, the term ``function'' is applied to numerous names in REDTEN; it should be understood that these names are in fact the user handle through which the true lisp function is found and executed. If the user looks for a definition of, say, riemann, it will not be found, rather a property value under the key simpfn indicates that the real lisp function that is executed is named riemann!* (however, see §F.1 for an important consideration).



next up previous contents index
Next: Property Lists Up: Concepts in REDUCE Previous: Notation



John Harper
Wed Nov 16 13:34:23 EST 1994