CoCoA:Distrib
From ApCoCoAWiki
Distrib
the distribution of objects in a 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([<quotes>b</quotes>,<quotes>a</quotes>,<quotes>b</quotes>,4,4,[1,2]]); [[<quotes>b</quotes>, 2], [<quotes>a</quotes>, 1], [4, 2], [[1, 2], 1]] -------------------------------
Syntax
Distrib(L:LIST):LIST
<type>list</type>