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 PartialOrder
- >: (%, %) -> Boolean
from PartialOrder
- arity: % -> Union(NonNegativeInteger, failed)
arity(op)returnsnifopisn-ary, and “failed” ifophas arbitrary arity.
- assert: (%, Symbol) -> %
assert(op, s)attaches propertystoop. Argumentopis modified “in place”, i.e. no copy is made.
- coerce: % -> OutputForm
from CoercibleTo OutputForm
- comparison: (%, (%, %) -> Boolean) -> %
comparison(op, foo?)attaches foo? as the “%less?” property toop. Ifop1andop2have the same name, and one of them has a “%less?” propertyf, thenf(op1, op2)is called to decide whetherop1 < op2.
- copy: % -> %
copy(op)returns a copy ofop.
- deleteProperty!: (%, Symbol) -> %
deleteProperty!(op, s)unattaches propertysfromop. Argumentopis modified “in place”, i.e. no copy is made.
- display: % -> Union(List OutputForm -> OutputForm, failed)
display(op)returns the “%display” property ofopif it has one attached, and “failed” otherwise.
- display: (%, List OutputForm -> OutputForm) -> %
display(op, foo)attaches foo as the “%display” property ofop. Ifophas a “%display” propertyf, thenop(a1,...,an)gets converted to OutputForm asf(a1, ..., an).
- display: (%, OutputForm -> OutputForm) -> %
display(op, foo)attaches foo as the “%display” property ofop. Ifophas a “%display” propertyf, thenop(a)gets converted to OutputForm asf(a). Argumentopmust be unary.
- equality: (%, (%, %) -> Boolean) -> %
equality(op, foo?)attaches foo? as the “%equal?” property toop. Ifop1andop2have the same name, and one of them has an “%equal?” propertyf, thenf(op1, op2)is called to decide whetherop1andop2should be considered equal.
- input: % -> Union(List InputForm -> InputForm, failed)
input(op)returns the “%input” property ofopif it has one attached, “failed” otherwise.
- input: (%, List InputForm -> InputForm) -> %
input(op, foo)attaches foo as the “%input” property ofop. Ifophas a “%input” propertyf, thenop(a1,...,an)gets converted to InputForm asf(a1, ..., an).
- latex: % -> String
from SetCategory
- max: (%, %) -> %
from OrderedSet
- min: (%, %) -> %
from OrderedSet
- name: % -> Symbol
name(op)returns the name ofop.
- nary?: % -> Boolean
nary?(op)tests ifophas arbitrary arity.
- nullary?: % -> Boolean
nullary?(op)tests ifopis nullary.
- operator: (Symbol, NonNegativeInteger) -> %
operator(f, n)makesfinto ann-ary operator.
- operator: Symbol -> %
operator(f)makesfinto an operator with arbitrary arity.
- properties: % -> AssociationList(Symbol, None)
properties(op)returns the list of all the properties currently attached toop.
- property: (%, Symbol) -> Union(None, failed)
property(op, s)returns the value of propertysif it is attached toop, and “failed” otherwise.
- setProperties: (%, AssociationList(Symbol, None)) -> %
setProperties(op, l)sets the property list ofoptol. Argumentopis modified “in place”, i.e. no copy is made.
- setProperty: (%, Symbol, None) -> %
setProperty(op, s, v)attaches propertystoop, and sets its value tov. Argumentopis modified “in place”, i.e. no copy is made.
- smaller?: (%, %) -> Boolean
from Comparable
- unary?: % -> Boolean
unary?(op)tests ifopis unary.
- weight: % -> NonNegativeInteger
weight(op)returns the weight attached toop.
- weight: (%, NonNegativeInteger) -> %
weight(op, n)attaches the weightntoop.