Macaulay2 » Documentation
Packages » VisibleList > Sequence
next | previous | forward | backward | up | index | toc

Sequence -- the class of all sequences -- (...)

Description

A sequence is an ordered collection of things enclosed by parentheses and separated by commas. Use # to get the length of a sequence of to get one of the elements.

i1 : v = (a,b,c)

o1 = (a, b, c)

o1 : Sequence
i2 : #v

o2 = 3
i3 : v#2

o3 = c

o3 : Symbol

To convert sequences to and from other types of BasicList, in addition to toSequence, one may use new.

i4 : new Array from (a,b,c)

o4 = [a, b, c]

o4 : Array
i5 : new Sequence from [a,b,c]

o5 = (a, b, c)

o5 : Sequence

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

Functions and methods returning a sequence:

Methods that use a sequence:

For the programmer

The object Sequence is a type, with ancestor classes VisibleList < BasicList < Thing.