up previous next
distrib

the distribution of objects in a list

Syntax
distrib(L: LIST): LIST

Description
For each object E of a list L, let N(E) be the number of times E occurs as a component of L. Then Distrib(L) returns the list whose components are [E, N(E)].

Example
/**/  distrib(["b","a","b",4,4,[1,2]]);
[["b", 2], ["a", 1], [4, 2], [[1, 2], 1]]

See Also