Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » lists and sequences » BasicList
next | previous | forward | backward | up | index | toc

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 sequence 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
Here are the core types that inherit from BasicList:

Menu

Types of basic list:

  • Command -- the class of all commands
  • Eliminate -- elimination order
  • Expression -- the class of all expressions
  • FilePosition -- the class of all file positions
  • IndexedVariable -- the class of all indexed variables
  • Manipulator -- the class of all file manipulators
  • MutableList -- the class of all mutable lists
  • Option -- the class of all key-value pairs K => V
  • Partition -- a type of list representing a partition of a natural number
  • ProductOrder -- product ordering
  • RingElement -- the class of all ring elements handled by the engine
  • Time -- the class of all timing results
  • URL -- a type representing a URL
  • Vector -- the class of all elements of modules that are handled by the engine
  • VisibleList -- the class of all visible lists

Functions and methods returning a basic list:

  • append(BasicList,Thing) -- see append -- add an element to the end of a 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
  • insert(ZZ,Thing,BasicList) -- see insert -- copy a list, inserting an element
  • 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
  • replace(ZZ,Thing,BasicList) -- copy a list, replacing an element
  • reverse(BasicList) -- see reverse -- reverse a list, sequence, or string
  • 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
  • switch(ZZ,ZZ,BasicList) -- see switch -- copy a list, switching two elements
  • 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 -- see # List -- length or cardinality of a list, hash table, dictionary, set, or string
  • 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) -- see all(BasicList,Function) -- whether all elements of a list satisfy a specified 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
  • applyPairs(BasicList,Function) -- see applyPairs -- apply a function to each pair in a hash table
  • ascii(BasicList) -- see ascii -- ASCII character conversion
  • concatenate(BasicList) -- see concatenate -- join strings
  • delete(Thing,BasicList) -- see delete -- delete some elements of a list
  • hashTable(BasicList) -- see hashTable -- make a hash table
  • hashTable(Function,BasicList) -- see hashTable -- make a hash table
  • horizontalJoin(BasicList) -- see horizontalJoin -- join nets or strings horizontally
  • BasicList # ZZ -- see List # ZZ -- get value from list, hash table, database, dictionary, or string
  • 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 or string into several shorter lists or strings
  • pack(ZZ,BasicList) -- see pack -- pack elements of a list or string into several shorter lists or strings
  • pairs(BasicList) -- see pairs -- list the pairs in a hash table, dictionary, or basic list
  • parallelApply(BasicList,Function) -- see parallelApply -- apply a function to each element in parallel
  • 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
  • selectPairs(BasicList,Function) -- see selectPairs -- select a part of a hash table by pairs
  • selectPairs(ZZ,BasicList,Function) -- see selectPairs -- select a part of a hash table by pairs
  • 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.


The source of this document is in Macaulay2Doc/ov_lists.m2:570:0.