|
|
last edited 9 years ago by test1 |
1 2 | ||
Editor: test1
Time: 2015/06/01 19:17:14 GMT+0 |
||
Note: |
added: 'f(x)' is computed by 'elt' in ExpressionSpace. 'elt' uses 'belong?' to check for correct operator and complains otherwise. AlgebraicNumber defines: belong? op == belong?(op)$ExpressionSpace_&(%) or has?(op, ALGOP) changed: -whereas Expression overrides this with:: so 'f' is not among allowed operators, whereas Expression defines::
This fails unexpectedly:
(1) -> f:=operator 'f
(1) |
f(sin(-1))
(2) |
f(sqrt(-1))
>> Error detected within library code: Unknown operator 3: f
But this works
f(sqrt(-1)::Expression(Integer))
(3) |
This happens because sqrt(-1)
is interpreted as an AlgebraicNumber? and
AlgebraicNumber has ExpressionSpace
(4) |
f(x)
is computed by elt
in ExpressionSpace?. elt
uses belong?
to
check for correct operator and complains otherwise.
belong? op == belong?(op)$ExpressionSpace?_&(%) or has?(op, ALGOP)
while ExpressionSpace? exports:
belong? op == has?(op, 'any) and (is?(op, PAREN) or is?(op, BOX))
so f
is not among allowed operators, whereas Expression defines:
belong? op == true