REDUCE

6.6 DEFINE Command

The command define allows a user to supply a new name for any identifier or replace it by any well-formed expression. Its argument is a list of expressions of the form

\(\langle \)identifier\(\rangle \) = \(\langle \)number\(\rangle \)\(\ \mid \ \)\(\langle \)identifier\(\rangle \)\(\ \mid \ \)\(\langle \)operator\(\rangle \)\(\ \mid \ \)
\(\langle \)reserved word\(\rangle \)\(\ \mid \ \)\(\langle \)expression\(\rangle \)

Example:

        define be==,x=y+z;

means that be will be interpreted as an equal sign, and x as the expression y+z from then on. This renaming is done at parse time, and therefore takes precedence over any other replacement declared for the same identifier. It stays in effect until the end of the REDUCE run.

The identifiers algebraic and symbolic have properties which prevent define from being used on them. To define alg to be a synonym for algebraic, use the more complicated construction

        put(’alg,’newnam,’algebraic);


Hosted by Download REDUCE Powered by MathJax