[ Obsolete | Reference Manual | Alphabetic Index ]

abolish_op(+Name, +Associativity)

Remove the declaration of the visible operator +Name of associativity Associativity.
Name
Atom
Associativity
Atom.

This built-in predicate is obsolete!

Description

Used to remove the local declaration of the operator Name defined in the context module or to remove the hiding of a global operator declaration (made with local_op(0, Associativity, Name)) so that the global operator declaration becomes visible again.

If no operator Name with associativity Associativity is visible from the context module, error 72 is raised.

If Associativity is not one of following atoms, a range error is raised:

----------------------------
 xfx           infix
 xfy           infix
 yfx           infix
 fx            prefix
 fy            prefix
 xf            postfix
 yf            postfix

Modes and Determinism

Modules

This predicate is sensitive to its module context (tool predicate, see @/2).

Exceptions

(4) instantiation fault
Name or Associativity is uninstantiated.
(5) type error
Name is not an atom.
(5) type error
Associativity is not an atom.
(6) out of range
Associativity is not a valid associativity name.
(72) accessing an undefined operator
there is no operator Name with associativity Associativity visible from the context module.

Examples

Success:
      [eclipse]: op(100, fx, -+-).
      yes. % defined a global prefix operator
      [eclipse]: local_op(0, fy, -+-).
      yes. % hide any global prefix operator
      [eclipse]: current_op(X, Y, -+-).
      no (more) solution.
      [eclipse]: abolish_op(-+-, fy).
      yes. % remove the hiding
      [eclipse]: current_op(X, Y, -+-).
      X = 100
      Y = fx     More? (;)  % global visible again
      no (more) solution.
      [eclipse]: abolish_op(-+-, fx).
      yes. % remove the global definition
      [eclipse]: current_op(X, Y, -+-).
      no (more) solution.

Error:
      abolish_op(X, yfx).         (Error 4)
      abolish_op(+, X).           (Error 4)
      abolish_op("+", yfx).       (Error 5)
      abolish_op(+, 12).          (Error 5)
      abolish_op(+, fff).         (Error 6)
      abolish_op(no_op, fx).      (Error 72)
      local_op(100, fx, +),
          abolish_op(+, fy).      (Error 72).



See Also

current_op / 3, global_op / 3, op / 3