[top][index]
search for:

mingle -- mingle elements of several lists

mingle {v,w,...} -- produces a new list from the lists or sequences v,w,... by taking the first element from each, then the second, and so on.
mingle (v,w,...) -- does the same.

After one of the lists is exhausted, it is silently ignored.

i1 : mingle({1,2,3,4},{a},{F,F,F,F,F,F,F,F,F,F})

o1 = {1, a, F, 2, F, 3, F, 4, F, F, F, F, F, F, F}

o1 : List
i2 : concatenate mingle( {"a","b","c"} , {",",","} )

o2 = a,b,c

It is easy to transpose a nested list (thinking of it as a matrix) using mingle and pack.

i3 : pack(2, mingle {{1,2,3,4},{5,6,7,8}})

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

o3 : List

Ways to use mingle :

  • mingle BasicList

  • [top][index]
    search for: