3.6. Evaluation control

The evaluation control function are in fact what is called ‘meta functions’.

3.6.1. Evaluation control

Hold(subexpr)

When this function is found in an evaluated zone, it preserve it’s content from any substitution/reduction. Use it if you want to avoid transformation of some formula’s part.

Force(subexpr)

This function is the inverse Hold, when found in area without evaluation, it force the evaluation of it’s sub expression.

$ eq eval "d(x) :> derivate( x, y ); d( y + 5 + 13 * y )"
0

The previous command doesn’t work, because the derivate function doesn’t evaluate both of it’s argument, if you want a substitution you have to force it :

$ eq eval "d(x) :> derivate( Force(x), y ); d( y + 5 + 13 * y )"
14

And you can use a more concise form of the form function :

$ eq eval "d(x) :> derivate( {x}, y ); d( y + 5 + 13 * y )"
14

3.6.2. Other meta functions

Expand(formula)

Experimental function, use at your own risk.

Cleanup(formula)

Remove trivial-simplification (multiplication by 1/0), just to cleanup more things. Normally performed internally.

Sort(formula)

Sort terms of a formula or a list in ascending order.

$ eq eval "Sort([15, 2, 3, x, a])"
[ 15, 2, 3, x, a ]

Table Of Contents

Previous topic

3.5. Lambda

Next topic

3.7. Operators

This Page