Fixing implementation of leach

db4
James Cash 2008-06-04 00:02:29 -04:00
parent 09d1154641
commit 8a7dfd76da
1 changed files with 2 additions and 3 deletions

View File

@ -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 ]