Vocabularymath.statisticsInputs and outputsWord descriptionApplies a quotation to each element in the input sequence and returns a
hashtable of like elements. The keys of this
hashtable are the output of
quot and the values at each key are the elements that transformed to that key.
ExamplesCollect even and odd elements:
USING: math math.statistics prettyprint ;
{ 11 12 13 14 14 13 12 11 } [ odd? ] collect-by .
H{ { f V{ 12 14 14 12 } } { t V{ 11 13 13 11 } } }
NotesMay be named
group-by in other languages.
Definition