sets: document combine word
parent
d2b20ddb35
commit
0b52600143
|
@ -190,3 +190,7 @@ HELP: null?
|
||||||
HELP: cardinality
|
HELP: cardinality
|
||||||
{ $values { "set" set } { "n" "a non-negative integer" } }
|
{ $values { "set" set } { "n" "a non-negative integer" } }
|
||||||
{ $description "Returns the number of elements in the set. All sets support this operation." } ;
|
{ $description "Returns the number of elements in the set. All sets support this operation." } ;
|
||||||
|
|
||||||
|
HELP: combine
|
||||||
|
{ $values { "seq" "a sequence of sets" } { "set" set } }
|
||||||
|
{ $description "Outputs the union of a sequence of sets, or " { $link f } " if the sequence is empty." } ;
|
||||||
|
|
|
@ -109,7 +109,7 @@ M: sequence null?
|
||||||
M: sequence cardinality
|
M: sequence cardinality
|
||||||
length ;
|
length ;
|
||||||
|
|
||||||
: combine ( sets -- set/f )
|
: combine ( sets -- set )
|
||||||
[ f ]
|
[ f ]
|
||||||
[ [ [ members ] map concat ] [ first ] bi set-like ]
|
[ [ [ members ] map concat ] [ first ] bi set-like ]
|
||||||
if-empty ;
|
if-empty ;
|
||||||
|
|
Loading…
Reference in New Issue