next up previous index
Next: Low Level Arithmetic Up: Arithmetic Functions Previous: User Defined Arithmetic

Runtime Expressions

In order to enable efficient compilation of arithmetic expressions, ECLiPSe imposes the following restriction on their dynamicity: If an expression contains an internal variable (ie. not the whole expression is a variable), this variable must not be bound to another arithmetic expression, but only to numbers. E.g. in the following code p/1 will only work when called with a numerical argument, else it will raise error 24:

p(Expr) :- Res is 1 + Expr, ...
q(Expr) :- Res is Expr, ...
On the other hand, q/1 may be called with arbitrary expressions, since Expr does not occur as part of another expression.



Micha Meier
Mon Mar 4 12:11:45 MET 1996