-USING: assocs hashtables help.markup help.syntax kernel
-quotations sequences vectors ;
+USING: assocs help.markup help.syntax kernel
+sequences vectors ;
IN: sets
ARTICLE: "sets" "Sets"
}
"Operations on groups of sets:"
{ $subsections
- combine
- refine
+ union-all
+ intersect-all
}
"An optional generic word for creating sets of the same class as a given set:"
{ $subsections set-like }
}
"Utilities for sets and sequences:"
{ $subsections
- within
- without
+ within
+ without
} ;
ARTICLE: "set-implementations" "Set implementations"
HELP: gather
{ $values
- { "seq" sequence } { "quot" { $quotation ( ... elt -- ... elts ) } }
- { "newseq" sequence } }
+ { "seq" sequence } { "quot" { $quotation ( ... elt -- ... elts ) } }
+ { "newseq" sequence } }
{ $description "Maps a quotation over a sequence, concatenates the results of the mapping, and removes duplicates." } ;
HELP: set-like
{ $values { "set" set } { "n" "a non-negative integer" } }
{ $description "Returns the number of elements in the set. All sets support this operation." } ;
-HELP: refine
+HELP: intersect-all
{ $values { "sets" sequence } { "set/f" { $maybe set } } }
{ $description "Outputs the intersection of all the sets of the sequence " { $snippet "sets" } ", or " { $link f } " if " { $snippet "sets" } " is empty." } ;
-HELP: combine
+HELP: union-all
{ $values { "sets" { $sequence set } } { "set/f" { $maybe set } } }
{ $description "Outputs the union of a sequence of sets, or " { $link f } " if the sequence is empty." } ;