PRECEDENCE INDEX

PRECEDENCE _ _ _ _ _ _ _ _ _ _ _ _ declaration

The precedence declaration attaches a precedence to an infix operator.

syntax:

precedence<operator>,<known\_operator>

<operator> should have been declared an operator but may be a REDUCE identifier that is not already an operator, array, or matrix. <known\_operator> must be a system infix operator or have had its precedence already declared.

examples:


operator f,h; 

precedence f,+; 

precedence h,*; 

a + f(1,2)*c; 

  (1 F 2)*C + A 


a + h(1,2)*c; 

  1 H 2*C + A 


a*1 f 2*c; 

  A F 2*C 


a*1 h 2*c; 

  1 H 2*A*C

The operator whose precedence is being declared is inserted into t he infix operator precedence list at the next higher place than <known\_operator>.

Attaching a precedence to an operator has the side effect of declaring the operator to be infix. If the identifier argument for precedence has not been declared to be an operator, an attempt to use it causes an error message. After declaring it to be an operator, it becomes an infix operator with the precedence previously given. Infix operators may be used in prefix form; if they are used in infix form, a space must be left on each side of the operator to avoid ambiguity. Declared infix operators are always binary.

To see the infix operator precedence list, enter symbolic mode and type preclis!*;. The lowest precedence operator is listed first.

All prefix operators have precedence higher than infix operators.