From f0251cb2adc3d6628e082bbcdcceb07be84bb8eb Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Wed, 28 Dec 2016 16:40:27 -0800 Subject: [PATCH] sequences: remove (indices). --- core/sequences/sequences.factor | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/core/sequences/sequences.factor b/core/sequences/sequences.factor index f38365741e..b559d36594 100644 --- a/core/sequences/sequences.factor +++ b/core/sequences/sequences.factor @@ -635,16 +635,10 @@ PRIVATE> : last-index-from ( obj i seq -- n ) rot [ = ] curry find-last-from drop ; - - : indices ( obj seq -- indices ) - swap V{ } clone - [ [ (indices) ] 2curry each-index ] keep ; + swap [ = ] curry [ swap ] prepose V{ } clone [ + [ push ] curry [ [ drop ] if ] curry compose each-index + ] keep ;