From 8a7dfd76da4dbda2731f63d85efcd514d5106ed7 Mon Sep 17 00:00:00 2001 From: James Cash Date: Wed, 4 Jun 2008 00:02:29 -0400 Subject: [PATCH] Fixing implementation of leach --- extra/lists/lists.factor | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/extra/lists/lists.factor b/extra/lists/lists.factor index b7e5e6523f..f9b7b89e5b 100644 --- a/extra/lists/lists.factor +++ b/extra/lists/lists.factor @@ -54,11 +54,10 @@ M: cons nil? ( cons -- ? ) 0 (llength) ; : leach ( list quot -- ) - over nil? [ 2drop ] [ [ uncons ] dip tuck call leach ] if ; inline + over nil? [ 2drop ] [ [ uncons swap ] dip tuck [ call ] 2dip leach ] if ; inline : lreduce ( list identity quot -- result ) - pick nil? [ drop nip ] - [ [ uncons ] 2dip swapd [ call ] keep lreduce ] if ; inline + swapd leach ; inline : (lmap) ( acc cons quot -- seq ) over nil? [ 2drop ]