A SNePSUL command is classified according to its role either as a procedure or as a function . A procedure is a command that performs some action but returns nothing, using the COMMON LISP (values) function. A function is a command that always returns some value, possibly after having performed some action as a side effect. A function is implemented directly as a Lisp function.
A command is also classified according to the environment(s) in which it may legally appear. A procedure can be entered only at the top level of SNePSUL. A function, however, may appear in many different environments. The five environments are:
Finally, a command can be classified according to the relation between its position and the position of its arguments in the input line.
Most commands have an arbitrary number of arguments. They are called prefix commands , because they can only be entered using Cambridge prefix notation: (prefix-command argument ...argument).
Some two-argument commands can be entered in infix position, and so are called infix commands . When an infix command is used in infix position, SNePS rearranges the input line to transform the form into a prefix form. Precedence is always from left to right. An infix command can be used as (infix-command argument argument) or as argument infix-command argument with no parentheses.
Since SNePS always remembers the result of the last top-level function, an infix command can also be used as infix-command argument in which case SNePS recalls the result of the last function and makes it the first argument for the infix command before rearranging the form to the prefix notation.
Similarly, some one-argument commands can be entered in postfix position and therefore are called postfix commands . A postfix command can be used as (postfix-command argument) or as argument postfix-command with no parentheses, or just as postfix-command in which case the result of the last function is used as argument.
Another kind of one-argument command, called macro commands , have one-character names and are used as macro-command argument with no parentheses, and preferably with no space between the command and the argument. Before passing it to the evaluator, the SNePS reader expands this form to a standard Cambridge prefix form.