Previous Up Next

6.1.10  Transforming sequences into lists and lists into sequences

To transform a sequence into list, you can put square brackets ([]) around the sequence. The makevector and nop commands have the same effect.

The makesuite command transforms a list into a sequence. Note that op (see Section 8.2.3) can do the same thing.

Examples

[seq(j^3,j=1..4)]

or:

[(j^3)$(j=1..4)]

or:

nop(j^3$(j=1..4))

or:

makevector(j^3$(j=1..4))
     

1,8,27,64
          
makesuite([0,1,2])

or:

op([0,1,2])
     
0,1,2           

Previous Up Next