Macaulay2 » Documentation
Packages » Macaulay2Doc :: toList
next | previous | forward | backward | up | index | toc

toList -- create a list

Synopsis

Description

i1 : toList "foo"

o1 = {f, o, o}

o1 : List
i2 : A = set(3,7,9,6)

o2 = set {3, 6, 7, 9}

o2 : Set
i3 : toList A

o3 = {9, 3, 6, 7}

o3 : List

The command toList 1..9 will throw an error, because toList comes before .. in Macaulay2's order of operations. To create a list from a range, use toList (1..9) instead.

i4 : toList (1..9)

o4 = {1, 2, 3, 4, 5, 6, 7, 8, 9}

o4 : List

Converting between list types may change the order of the elements in unexpected ways.

i5 : toList set {4,5,13}

o5 = {4, 13, 5}

o5 : List

See also

Ways to use toList :

For the programmer

The object toList is a method function with a single argument.