diff --git a/basis/sequences/deep/deep.factor b/basis/sequences/deep/deep.factor index 86388a8af0..e4edd80685 100644 --- a/basis/sequences/deep/deep.factor +++ b/basis/sequences/deep/deep.factor @@ -29,6 +29,12 @@ M: object branch? drop f ; : deep-filter ( ... obj quot: ( ... elt -- ... ? ) -- ... seq ) over dup branch? [ drop f ] unless deep-filter-as ; inline +: deep-reject-as ( ... obj quot: ( ... elt -- ... ? ) exemplar -- ... seq ) + [ [ not ] compose ] dip deep-filter-as ; inline + +: deep-reject ( ... obj quot: ( ... elt -- ... ? ) -- ... seq ) + [ not ] compose deep-filter ; inline + : (deep-find) ( ... obj quot: ( ... elt -- ... ? ) -- ... elt ? ) [ call ] 2keep rot [ drop t ] [ over branch? [ @@ -59,7 +65,7 @@ M: object branch? drop f ; ] [ drop ] if ; inline recursive : flatten ( obj -- seq ) - [ branch? not ] deep-filter ; + [ branch? ] deep-reject ; : flatten-as ( obj exemplar -- seq ) - [ branch? not ] swap deep-filter-as ; + [ branch? ] swap deep-reject-as ;