|
|
|
last edited 10 years ago by test1 |
| 1 2 | ||
|
Editor: Bill Page
Time: 2015/03/16 16:59:00 GMT+0 |
||
| Note: awkward | ||
changed: - This fails unexpectedly: \begin{axiom} f:=operator 'f f(sin(-1)) f(sqrt(-1)) \end{axiom} But this works \begin{axiom} f(sqrt(-1)::Expression(Integer)) \end{axiom} This happens because 'sqrt(-1)' is interpreted as an AlgebraicNumber and \begin{axiom} AlgebraicNumber has ExpressionSpace \end{axiom} while ExpressionSpace exports:: belong? op == has?(op, 'any) and (is?(op, PAREN) or is?(op, BOX)) whereas Expression overrides this with:: belong? op == true
This fails unexpectedly:
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) |
while ExpressionSpace? exports:
belong? op ==
has?(op, 'any) and (is?(op, PAREN) or is?(op, BOX))
whereas Expression overrides this with:
belong? op == true