From: John Benediktsson Date: Wed, 13 May 2015 02:08:21 +0000 (-0700) Subject: sequences: adding related-words for filter and reject. X-Git-Tag: unmaintained~2754 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=55122d914125cfa054838aeaa06716a6e27230fc sequences: adding related-words for filter and reject. --- diff --git a/core/sequences/sequences-docs.factor b/core/sequences/sequences-docs.factor index b8f59d7f6e..9504b360c4 100644 --- a/core/sequences/sequences-docs.factor +++ b/core/sequences/sequences-docs.factor @@ -513,6 +513,8 @@ HELP: filter! { $description "Applies the quotation to each element in turn, and removes elements for which the quotation outputs a false value." } { $side-effects "seq" } ; +{ filter filter-as filter! } related-words + HELP: reject { $values { "seq" sequence } { "quot" { $quotation ( ... elt -- ... ? ) } } { "subseq" "a new sequence" } } { $description "Applies the quotation to each element in turn, and outputs a new sequence removing with the elements of the original sequence for which the quotation output a true value." } ; @@ -526,6 +528,8 @@ HELP: reject! { $description "Applies the quotation to each element in turn, and removes elements for which the quotation outputs a true value." } { $side-effects "seq" } ; +{ reject reject-as reject! } related-words + HELP: interleave { $values { "seq" sequence } { "between" quotation } { "quot" { $quotation ( ... elt -- ... ) } } } { $description "Applies " { $snippet "quot" } " to each element in turn, also invoking " { $snippet "between" } " in-between each pair of elements." }