next up previous contents
Next: Variables Up: TERMINAL INPUT Previous: Command symbols   Contents


Variables and expressions

Finally, we should mention a further method by which commands can fetch parameter values. If at any time the input is a valid arithmetic expression involving only constants, defined variables, and supplied functions, then the expression will be evaluated and the resulting value used as input. As a concrete example, let us suppose that the (real) variable x and the (integer) variable n have both been defined, and have sensible values. Then for instance the transaction:

    >> offset-spectrum x+2*n
would be a valid command line. The expression $x+2*n$ is first translated according to the normal rules of precedence, and then used as a response to the ``Offset? " prompt.



Subsections

Jamie Leech 2004-08-16