BasicOperator

op.spad line 1 [edit on github]

A basic operator is an object that can be applied to a list of arguments from a set, the result being a kernel over that set.

< : (%, %) -> Boolean
from PartialOrder
<= : (%, %) -> Boolean
from PartialOrder
= : (%, %) -> Boolean
from BasicType
> : (%, %) -> Boolean
from PartialOrder
>= : (%, %) -> Boolean
from PartialOrder
arity : % -> Union(NonNegativeInteger, "failed")

arity(op) returns n if op is n-ary, and "failed" if op has arbitrary arity.

assert : (%, Symbol) -> %

assert(op, s) attaches property s to op. Argument op is modified "in place", i.e. no copy is made.

coerce : % -> OutputForm
from CoercibleTo(OutputForm)
comparison : (%, Mapping(Boolean, %, %)) -> %

comparison(op, foo?) attaches foo? as the "%less?" property to op. If op1 and op2 have the same name, and one of them has a "%less?" property f, then f(op1, op2) is called to decide whether op1 < op2.

copy : % -> %

copy(op) returns a copy of op.

deleteProperty! : (%, Symbol) -> %

deleteProperty!(op, s) unattaches property s from op. Argument op is modified "in place", i.e. no copy is made.

display : (%, Mapping(OutputForm, List(OutputForm))) -> %

display(op, foo) attaches foo as the "%display" property of op. If op has a "%display" property f, then op(a1,...,an) gets converted to OutputForm as f(a1, ..., an).

display : (%, Mapping(OutputForm, OutputForm)) -> %

display(op, foo) attaches foo as the "%display" property of op. If op has a "%display" property f, then op(a) gets converted to OutputForm as f(a). Argument op must be unary.

display : % -> Union(Mapping(OutputForm, List(OutputForm)), "failed")

display(op) returns the "%display" property of op if it has one attached, and "failed" otherwise.

equality : (%, Mapping(Boolean, %, %)) -> %

equality(op, foo?) attaches foo? as the "%equal?" property to op. If op1 and op2 have the same name, and one of them has an "%equal?" property f, then f(op1, op2) is called to decide whether op1 and op2 should be considered equal.

has? : (%, Symbol) -> Boolean

has?(op, s) tests if property s is attached to op.

input : (%, Mapping(InputForm, List(InputForm))) -> %

input(op, foo) attaches foo as the "%input" property of op. If op has a "%input" property f, then op(a1,...,an) gets converted to InputForm as f(a1, ..., an).

input : % -> Union(Mapping(InputForm, List(InputForm)), "failed")

input(op) returns the "%input" property of op if it has one attached, "failed" otherwise.

is? : (%, Symbol) -> Boolean

is?(op, s) tests if the name of op is s.

latex : % -> String
from SetCategory
max : (%, %) -> %
from OrderedSet
min : (%, %) -> %
from OrderedSet
name : % -> Symbol

name(op) returns the name of op.

nary? : % -> Boolean

nary?(op) tests if op has arbitrary arity.

nullary? : % -> Boolean

nullary?(op) tests if op is nullary.

operator : Symbol -> %

operator(f) makes f into an operator with arbitrary arity.

operator : (Symbol, NonNegativeInteger) -> %

operator(f, n) makes f into an n-ary operator.

properties : % -> AssociationList(Symbol, None)

properties(op) returns the list of all the properties currently attached to op.

property : (%, Symbol) -> Union(None, "failed")

property(op, s) returns the value of property s if it is attached to op, and "failed" otherwise.

setProperties : (%, AssociationList(Symbol, None)) -> %

setProperties(op, l) sets the property list of op to l. Argument op is modified "in place", i.e. no copy is made.

setProperty : (%, Symbol, None) -> %

setProperty(op, s, v) attaches property s to op, and sets its value to v. Argument op is modified "in place", i.e. no copy is made.

smaller? : (%, %) -> Boolean
from Comparable
unary? : % -> Boolean

unary?(op) tests if op is unary.

weight : (%, NonNegativeInteger) -> %

weight(op, n) attaches the weight n to op.

weight : % -> NonNegativeInteger

weight(op) returns the weight attached to op.

~= : (%, %) -> Boolean
from BasicType

SetCategory

CoercibleTo(OutputForm)

OrderedSet

Comparable

BasicType

PartialOrder