List(S)

list.spad line 19 [edit on github]

List implements singly-linked lists that are addressable by indices; the index of the first element is 1. In addition to the operations provided by ListAggregate, this constructor provides some LISP-like functions such as cons and append.

# : % -> NonNegativeInteger
from Aggregate
< : (%, %) -> Boolean if S has OrderedSet
from PartialOrder
<= : (%, %) -> Boolean if S has OrderedSet
from PartialOrder
= : (%, %) -> Boolean if S has BasicType
from BasicType
> : (%, %) -> Boolean if S has OrderedSet
from PartialOrder
>= : (%, %) -> Boolean if S has OrderedSet
from PartialOrder
OMwrite : % -> String if S has OpenMath
from OpenMath
OMwrite : (%, Boolean) -> String if S has OpenMath
from OpenMath
OMwrite : (OpenMathDevice, %) -> Void if S has OpenMath
from OpenMath
OMwrite : (OpenMathDevice, %, Boolean) -> Void if S has OpenMath
from OpenMath
any? : (Mapping(Boolean, S), %) -> Boolean
from HomogeneousAggregate(S)
append : (%, %) -> %

append(u1, u2) appends the elements of list u1 onto the front of list u2. This new list and u2 will share some structure.

child? : (%, %) -> Boolean if S has BasicType
from RecursiveAggregate(S)
children : % -> List(%)
from RecursiveAggregate(S)
coerce : % -> OutputForm if S has CoercibleTo(OutputForm)
from CoercibleTo(OutputForm)
concat : (%, %) -> %
from LinearAggregate(S)
concat : (%, S) -> %
from LinearAggregate(S)
concat : (S, %) -> %
from LinearAggregate(S)
concat : List(%) -> %
from LinearAggregate(S)
concat! : (%, %) -> %
from ExtensibleLinearAggregate(S)
concat! : (%, S) -> %
from ExtensibleLinearAggregate(S)
concat! : List(%) -> %
from UnaryRecursiveAggregate(S)
cons : (S, %) -> %

cons(element, u) appends element onto the front of list u and returns the new list. This new list and the old one will share some structure.

construct : List(S) -> %
from Collection(S)
convert : % -> InputForm if S has ConvertibleTo(InputForm)
from ConvertibleTo(InputForm)
copy : % -> %
from Aggregate
copyInto! : (%, %, Integer) -> %
from LinearAggregate(S)
count : (S, %) -> NonNegativeInteger if S has BasicType
from HomogeneousAggregate(S)
count : (Mapping(Boolean, S), %) -> NonNegativeInteger
from HomogeneousAggregate(S)
cycleEntry : % -> %
from UnaryRecursiveAggregate(S)
cycleLength : % -> NonNegativeInteger
from UnaryRecursiveAggregate(S)
cycleSplit! : % -> %
from UnaryRecursiveAggregate(S)
cycleTail : % -> %
from UnaryRecursiveAggregate(S)
cyclic? : % -> Boolean
from RecursiveAggregate(S)
delete : (%, Integer) -> %
from LinearAggregate(S)
delete : (%, UniversalSegment(Integer)) -> %
from LinearAggregate(S)
delete! : (%, Integer) -> %
from ExtensibleLinearAggregate(S)
delete! : (%, UniversalSegment(Integer)) -> %
from ExtensibleLinearAggregate(S)
distance : (%, %) -> Integer
from RecursiveAggregate(S)
elt : (%, "rest") -> %
from UnaryRecursiveAggregate(S)
elt : (%, UniversalSegment(Integer)) -> %
from Eltable(UniversalSegment(Integer), %)
elt : (%, "first") -> S
from UnaryRecursiveAggregate(S)
elt : (%, "last") -> S
from UnaryRecursiveAggregate(S)
elt : (%, "value") -> S
from RecursiveAggregate(S)
elt : (%, Integer) -> S
from Eltable(Integer, S)
elt : (%, Integer, S) -> S
from EltableAggregate(Integer, S)
empty : () -> %
from Aggregate
empty? : % -> Boolean
from Aggregate
entries : % -> List(S)
from IndexedAggregate(Integer, S)
entry? : (S, %) -> Boolean if S has BasicType
from IndexedAggregate(Integer, S)
eq? : (%, %) -> Boolean
from Aggregate
eval : (%, S, S) -> % if S has Evalable(S) and S has SetCategory
from InnerEvalable(S, S)
eval : (%, Equation(S)) -> % if S has Evalable(S) and S has SetCategory
from Evalable(S)
eval : (%, List(S), List(S)) -> % if S has Evalable(S) and S has SetCategory
from InnerEvalable(S, S)
eval : (%, List(Equation(S))) -> % if S has Evalable(S) and S has SetCategory
from Evalable(S)
every? : (Mapping(Boolean, S), %) -> Boolean
from HomogeneousAggregate(S)
explicitlyFinite? : % -> Boolean
from StreamAggregate(S)
fill! : (%, S) -> %
from IndexedAggregate(Integer, S)
find : (Mapping(Boolean, S), %) -> Union(S, "failed")
from Collection(S)
first : (%, NonNegativeInteger) -> %
from LinearAggregate(S)
first : % -> S
from IndexedAggregate(Integer, S)
hash : % -> SingleInteger if S has Hashable
from Hashable
hashUpdate! : (HashState, %) -> HashState if S has Hashable
from Hashable
index? : (Integer, %) -> Boolean
from IndexedAggregate(Integer, S)
indices : % -> List(Integer)
from IndexedAggregate(Integer, S)
insert : (%, %, Integer) -> %
from LinearAggregate(S)
insert : (S, %, Integer) -> %
from LinearAggregate(S)
insert! : (%, %, Integer) -> %
from ExtensibleLinearAggregate(S)
insert! : (S, %, Integer) -> %
from ExtensibleLinearAggregate(S)
last : (%, NonNegativeInteger) -> %
from UnaryRecursiveAggregate(S)
last : % -> S
from UnaryRecursiveAggregate(S)
latex : % -> String if S has SetCategory
from SetCategory
leaf? : % -> Boolean
from RecursiveAggregate(S)
leaves : % -> List(S)
from RecursiveAggregate(S)
leftTrim : (%, S) -> % if S has BasicType
from LinearAggregate(S)
less? : (%, NonNegativeInteger) -> Boolean
from Aggregate
list : S -> %
from ListAggregate(S)
map : (Mapping(S, S), %) -> %
from HomogeneousAggregate(S)
map : (Mapping(S, S, S), %, %) -> %
from LinearAggregate(S)
map! : (Mapping(S, S), %) -> %
from HomogeneousAggregate(S)
max : (%, %) -> % if S has OrderedSet
from OrderedSet
max : % -> S if S has OrderedSet
from HomogeneousAggregate(S)
max : (Mapping(Boolean, S, S), %) -> S
from HomogeneousAggregate(S)
maxIndex : % -> Integer
from IndexedAggregate(Integer, S)
member? : (S, %) -> Boolean if S has BasicType
from HomogeneousAggregate(S)
members : % -> List(S)
from HomogeneousAggregate(S)
merge : (%, %) -> % if S has OrderedSet
from LinearAggregate(S)
merge : (Mapping(Boolean, S, S), %, %) -> %
from LinearAggregate(S)
merge! : (%, %) -> % if S has OrderedSet
from ExtensibleLinearAggregate(S)
merge! : (Mapping(Boolean, S, S), %, %) -> %
from ExtensibleLinearAggregate(S)
min : (%, %) -> % if S has OrderedSet
from OrderedSet
min : % -> S if S has OrderedSet
from HomogeneousAggregate(S)
minIndex : % -> Integer
from IndexedAggregate(Integer, S)
more? : (%, NonNegativeInteger) -> Boolean
from Aggregate
new : (NonNegativeInteger, S) -> %
from LinearAggregate(S)
node? : (%, %) -> Boolean if S has BasicType
from RecursiveAggregate(S)
nodes : % -> List(%)
from RecursiveAggregate(S)
parts : % -> List(S)
from HomogeneousAggregate(S)
position : (S, %) -> Integer if S has BasicType
from LinearAggregate(S)
position : (S, %, Integer) -> Integer if S has BasicType
from LinearAggregate(S)
position : (Mapping(Boolean, S), %) -> Integer
from LinearAggregate(S)
possiblyInfinite? : % -> Boolean
from StreamAggregate(S)
qelt : (%, Integer) -> S
from EltableAggregate(Integer, S)
qsetelt! : (%, Integer, S) -> S
from EltableAggregate(Integer, S)
qsetfirst! : (%, S) -> S
from UnaryRecursiveAggregate(S)
qsetrest! : (%, %) -> %
from UnaryRecursiveAggregate(S)
reduce : (Mapping(S, S, S), %) -> S
from Collection(S)
reduce : (Mapping(S, S, S), %, S) -> S
from Collection(S)
reduce : (Mapping(S, S, S), %, S, S) -> S if S has BasicType
from Collection(S)
remove : (S, %) -> % if S has BasicType
from Collection(S)
remove : (Mapping(Boolean, S), %) -> %
from Collection(S)
remove! : (S, %) -> % if S has BasicType
from ExtensibleLinearAggregate(S)
remove! : (Mapping(Boolean, S), %) -> %
from ExtensibleLinearAggregate(S)
removeDuplicates : % -> % if S has BasicType
from Collection(S)
removeDuplicates! : % -> % if S has BasicType
from ExtensibleLinearAggregate(S)
rest : % -> %
from UnaryRecursiveAggregate(S)
rest : (%, NonNegativeInteger) -> %
from UnaryRecursiveAggregate(S)
reverse : % -> %
from LinearAggregate(S)
reverse! : % -> %
from LinearAggregate(S)
rightTrim : (%, S) -> % if S has BasicType
from LinearAggregate(S)
sample : () -> %
from Aggregate
second : % -> S
from UnaryRecursiveAggregate(S)
select : (Mapping(Boolean, S), %) -> %
from Collection(S)
select! : (Mapping(Boolean, S), %) -> %
from ExtensibleLinearAggregate(S)
setDifference : (%, %) -> % if S has BasicType

setDifference(u1, u2) returns a list of the elements of u1 that are not also in u2. The order of elements in the resulting list is unspecified.

setIntersection : (%, %) -> % if S has BasicType

setIntersection(u1, u2) returns a list of the elements that lists u1 and u2 have in common. The order of elements in the resulting list is unspecified.

setUnion : (%, %) -> % if S has BasicType

setUnion(u1, u2) appends the two lists u1 and u2, then removes all duplicates. The order of elements in the resulting list is unspecified.

setchildren! : (%, List(%)) -> %
from RecursiveAggregate(S)
setelt! : (%, "rest", %) -> %
from UnaryRecursiveAggregate(S)
setelt! : (%, "first", S) -> S
from UnaryRecursiveAggregate(S)
setelt! : (%, "last", S) -> S
from UnaryRecursiveAggregate(S)
setelt! : (%, "value", S) -> S
from RecursiveAggregate(S)
setelt! : (%, Integer, S) -> S
from EltableAggregate(Integer, S)
setelt! : (%, UniversalSegment(Integer), S) -> S
from LinearAggregate(S)
setfirst! : (%, S) -> S
from UnaryRecursiveAggregate(S)
setlast! : (%, S) -> S
from UnaryRecursiveAggregate(S)
setrest! : (%, %) -> %
from UnaryRecursiveAggregate(S)
setvalue! : (%, S) -> S
from RecursiveAggregate(S)
size? : (%, NonNegativeInteger) -> Boolean
from Aggregate
smaller? : (%, %) -> Boolean if S has Comparable
from Comparable
sort : % -> % if S has OrderedSet
from LinearAggregate(S)
sort : (Mapping(Boolean, S, S), %) -> %
from LinearAggregate(S)
sort! : % -> % if S has OrderedSet
from LinearAggregate(S)
sort! : (Mapping(Boolean, S, S), %) -> %
from LinearAggregate(S)
sorted? : % -> Boolean if S has OrderedSet
from LinearAggregate(S)
sorted? : (Mapping(Boolean, S, S), %) -> Boolean
from LinearAggregate(S)
split! : (%, NonNegativeInteger) -> %
from UnaryRecursiveAggregate(S)
swap! : (%, Integer, Integer) -> Void
from IndexedAggregate(Integer, S)
tail : % -> %
from UnaryRecursiveAggregate(S)
tails : % -> List(%)

tails(u) returns list [rest(u, 0), rest(u, 1), ..., rest(u, #u - 1)].

third : % -> S
from UnaryRecursiveAggregate(S)
trim : (%, S) -> % if S has BasicType
from LinearAggregate(S)
value : % -> S
from RecursiveAggregate(S)
~= : (%, %) -> Boolean if S has BasicType
from BasicType

HomogeneousAggregate(S)

ConvertibleTo(InputForm)

shallowlyMutable

Collection(S)

Aggregate

LinearAggregate(S)

EltableAggregate(Integer, S)

OrderedSet

ExtensibleLinearAggregate(S)

finiteAggregate

PartialOrder

OpenMath

Eltable(UniversalSegment(Integer), %)

InnerEvalable(S, S)

Comparable

RecursiveAggregate(S)

StreamAggregate(S)

Hashable

FiniteLinearAggregate(S)

UnaryRecursiveAggregate(S)

CoercibleTo(OutputForm)

Eltable(Integer, S)

IndexedAggregate(Integer, S)

BasicType

Evalable(S)

ListAggregate(S)

SetCategory