[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] [#99 x^1 abc[y] should be a syntax error] Not a bug

From: anonymous
Subject: [Axiom-developer] [#99 x^1 abc[y] should be a syntax error] Not a bug
Date: Thu, 17 Feb 2005 06:07:32 -0600

To explain this, you have to understand several syntax conventions in Axiom.
When two expressions are separated by a space, it means "apply" as in
'f x' meaning 'f(x)'.  Exactly what "apply" does depends on 'f' and 'x'.
When 'f' is a symbol and 'x' is a list, this application produces a subscripted 
Also "apply" has higher precedence than any other operation. Finally, a 
symbol 'c'<SUB>'d'</SUB> when displayed on the Type info line is written as 
'*01c d'.

So 'abc' [ 'y' ] &nbsp; is the same as 'abc' &nbsp; [ 'y' ] &nbsp; (because 
clearly the left [ terminates the 
symbol 'abc') and so this is a subscripted symbol 'abc'<SUB>'y'</SUB>.

abc [y]

Now if 'b' is a symbol, then '1 b' is '1' applied to 'b'. Axiom tries to find 
what operation 
this application is, and finds one in 'UP(b,INT)' where the application means 
the element '1::UP(b,INT)' as a function at the value 'b' (substitution), which 
gives '1'.

1 (b::Symbol)

This is the same as


The results reported above are therefore all obtained by the these rules. The 
'x abc[y]' produces an error because this apply can only take place in UP 
(the fact that UP has only one variable makes the substitution unambiguous)
and although it actually makes sense under suitable domains, the interpreter 
is not smart enough to find it.

(x::UP(x, POLY INT)) (b::UP(x, POLY INT))

and actually, the construction UP(x, POLY INT) is not kosher, but somehow 
the extra parentheses helped.

x::UP(x, POLY INT) b::UP(x, POLY INT)

forwarded from

reply via email to

[Prev in Thread] Current Thread [Next in Thread]