SYNOPSIS

mixed * transpose_array( mixed *arr)

DESCRIPTION

Applied to an alist, results in an array of ({ key, data }) pairs, useful if you want to use sort_array(E) or filter(E) on the alist.

USAGE

transpose_array(({ ({1,2,3}), ({a,b,c}) }))
// returns ({ ({1,a}), ({2,b}), ({3,c}) })

The mapping ‘map’ in the example below is returned as an array of ({ key, data }) pairs, sorted by the keys.:

sort_array(transpose_array(({ m_indices(map), m_values(map) })),
       lambda(({ 'a, 'b }),
              ({ #'<, ({ #'[, 'a, 0 }),
                      ({ #'[, 'b, 0}) }) )

SEE ALSO

alists, sort_array(E)