# BasicList -- the class of all basic lists

## Description

For an overview of lists and sequences, see lists and sequences.

A basic list is a sequence of expressions indexed by a seequence of consecutive integers of the form 0, 1, ..., N-1. The number N is called the length of the list.

There are various types of basic lists, depending on the application, and they are displayed in different ways. The types first encountered are those of type VisibleList, but new types are easy to introduce. In the following example we introduce a new type of basic list called L.

 i1 : L = new Type of BasicList o1 = L o1 : Type i2 : x = new L from {a,b,c,d} o2 = L{a, b, c, d} o2 : L i3 : join(x,x) o3 = L{a, b, c, d, a, b, c, d} o3 : L

## Functions and methods returning a basic list :

• apply(BasicList,BasicList,Function) -- apply a function to pairs of elements, one from each list
• apply(BasicList,Function) -- apply a function to each element of a list
• "deepSplice(BasicList)" -- see deepSplice -- remove all levels of subsequences from a sequence or list
• "drop(BasicList,List)" -- see drop -- drop some elements from a list or sequence.
• "drop(BasicList,ZZ)" -- see drop -- drop some elements from a list or sequence.
• "mergePairs(BasicList,BasicList,Function)" -- see mergePairs -- merge sorted lists of pairs
• "prepend(Thing,BasicList)" -- see prepend -- add an element to the beginning of a list
• "reverse(BasicList)" -- see reverse -- reverse a list or sequence
• select(BasicList,Function) -- select elements from a list
• select(BasicList,Type) -- select elements of a given type in a list
• select(ZZ,BasicList,Function) -- select a limited number of elements from a list
• "splice(BasicList)" -- see splice -- remove subsequences from a sequence or list
• "take(BasicList,List)" -- see take -- Take some elements from a list or sequence.
• "take(BasicList,ZZ)" -- see take -- Take some elements from a list or sequence.

## Methods that use a basic list :

• # BasicList -- length or cardinality
• "BasicList #? ZZ" -- see #? -- check existence of value in a list, hash table, database, or string
• all(BasicList,BasicList,Function) -- whether all corresponding elements of a pair of lists satisfy a condition
• all(BasicList,Function) -- whether all elements of a list satisfy a specified condition
• any(BasicList,BasicList,Function) -- whether any corresponding elements of a pair of lists satisfy a condition
• any(BasicList,Function) -- whether any elements of a list satisfy a specified condition
• "apply(BasicList,String,Function)" -- see apply(BasicList,BasicList,Function) -- apply a function to pairs of elements, one from each list
• "apply(String,BasicList,Function)" -- see apply(BasicList,BasicList,Function) -- apply a function to pairs of elements, one from each list
• BasicList # ZZ -- get value from list, hash table, database, or string
• "concatenate(BasicList)" -- see concatenate -- join strings
• "horizontalJoin(BasicList)" -- see horizontalJoin -- join nets or strings horizontally
• "maxPosition(BasicList)" -- see maxPosition -- position of the largest element
• "mingle(BasicList)" -- see mingle -- mingle elements of several lists
• "minPosition(BasicList)" -- see minPosition -- position of the smallest element
• "pack(BasicList,ZZ)" -- see pack -- pack elements of a list into several shorter lists
• "pack(ZZ,BasicList)" -- see pack -- pack elements of a list into several shorter lists
• "pairs(BasicList)" -- see pairs -- list the pairs in a hash table, dictionary, or basic list
• partitions(Set,BasicList)
• "scan(BasicList,BasicList,Function)" -- see scan -- apply a function to each element in a list or sequence
• "scan(BasicList,Function)" -- see scan -- apply a function to each element in a list or sequence
• "stack(BasicList)" -- see stack -- join nets or string vertically
• "toList(BasicList)" -- see toList -- create a list
• "toSequence(BasicList)" -- see toSequence -- convert to sequence

## For the programmer

The object BasicList is a type, with ancestor class Thing.