Vocabularygrouping.
extrasInputsOutputsWord descriptionGroups consecutive elements by the key received by applying quot to each element in the sequence.
ExamplesUSING: grouping.extras unicode.data prettyprint sequences strings ;
"THis String Has CasE!" [ category ] group-by [ last >string ] { } map-as .
{ "TH" "is" " " "S" "tring" " " "H" "as" " " "C" "as" "E" "!" }
USING: grouping.extras prettyprint sequences strings ;
{ "apple" "anchovy" "banana" "anise" "bagel" "bratwurst" } [ first 1string ] group-by .
V{
{ "a" V{ "apple" "anchovy" } }
{ "b" V{ "banana" } }
{ "a" V{ "anise" } }
{ "b" V{ "bagel" "bratwurst" } }
}
See alsocollect-byDefinition