[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-users] back to basics - array trickery



What's the smart way to achieve a transformation like this.

source:
[[a,b], [1,2,3]]

output:
[[a,1], [a,2],[a,3], [b,1], [b,2],[b,3]]


Source material for input conforms to the following rules:

1. Only one level on nesting (as in the example above).
2. The nested-lists do not have to be the same length (as in the example above).
3. There can be any number of nested-lists (2 shown in example above).


It looks a little like flop or interlacing.  Has this process got a name?

Thanks
Mark

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/