Having several kinds of patterns allows patterns to be used for different purposes, e.g. code expansion, optimization, and language translation. The result of trans is the transformed expression. Each transform is basically a list of an input pattern and an output pattern. Most variables will match anything, provided that the variable matches the same thing consistently in a given input.
Partial evaluation is performed on many subexpressions whose operands are constant.
The cases form, which is similar in symtax to cond , allows this. Some transformations require computations to be done on input variables. Sometimes there is a need to introduce new variables in a pattern. This prevents the output of these patterns from matching any other pattern.