[top][index]
search for:

pack -- pack elements of a list into shorter ones

pack(n,v) -- packs the elements of the list or sequence v into a table n at a time.

It produces, from a list v, a list of lists formed by packing the elements of v into lists n at a time. The last of the lists produced may have fewer than n elements.

i1 : pack(3,{a,b,c,d,e,f,g,h,i,j,k})

o1 = {{a, b, c}, {d, e, f}, {g, h, i}, {j, k}}

o1 : List

Ways to use pack :

  • pack(BasicList,ZZ)
  • pack(ZZ,BasicList)

  • [top][index]
    search for: