Skip to content

List Processing Primitives

Basic

Primitive Description
List Literal Operator [x,y,...], creates a list
Range Operator x..y, creates a list of numbers from x to y
List Element Operator x[y], returns zero-based element(s) in a list
Subscript Operator x#y, returns one-based element(s) in a list
List Concatenate Operator x!!y, combines two lists
null Empty list
dim Dimensioned variable array
flatten Creates a flat list from a matrix or list of lists
group Matrix created by grouping elements in a list
sublist Segment of a list
last Last element in a list
replist Replaces a specific occurrence of a sublist
index The position of a particular element or sublist in a list
count Number of elements in a list
best Value and name of the greatest element in a list
compare Compares two lists

Objects

Primitive Description
Object Literal Operator {p1:x,p2:y,...}, creates an object
Property Operator x.y, accesses a named property in an object
propname Name of the currently executing method or property
consolidate Combines library component objects into a single consolidated object
partslist Builds a single consolidated object from a parts list of components
Boolean Operators Boolean object constructor
Math Operators Math object
Number Structures Number object constructor
Work with Objects General object constructor

Transformations

Transformations

Primitive Description
makelist List of f(n) over a range of n
each Applies a function to each element in a list
both Applies a function to groups of corresponding elements in two lists
sort List sorted from lowest to highest value
reverse Reverses the order of all elements in a list
trans Transpose of a matrix

Sets

Sets

Primitive Description
union All elements in all input lists without duplicates
intersect All elements common to every input list
different All elements unique to any one of several input lists

Conversion

Conversion

Primitive Description
tostring Converts a list or number to text
tonumber Number derived from a text string
tolist List created by parsing a string into substrings
tableform Table representation of a matrix