Difference between revisions of "CoCoA:Distrib"

From ApCoCoAWiki
(pushing XML rev. 1.46, again)
 
(No difference)

Latest revision as of 10:02, 24 October 2007

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

Count

   <type>list</type>