From 0eea37c13dabb02a18bd56804a3d05d9dbfedc8c Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 16 Aug 2008 16:05:00 -0500 Subject: [PATCH] add quad combinator inline the do-while combinator --- extra/combinators/lib/lib.factor | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extra/combinators/lib/lib.factor b/extra/combinators/lib/lib.factor index bbf6644b41..3b92844b3f 100755 --- a/extra/combinators/lib/lib.factor +++ b/extra/combinators/lib/lib.factor @@ -31,6 +31,8 @@ IN: combinators.lib ! Generalized versions of core combinators ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +: quad ( x p q r s -- ) >r >r >r keep r> keep r> keep r> call ; inline + : 4slip ( quot a b c d -- a b c d ) 4 nslip ; inline : 4keep ( w x y z quot -- w x y z ) 4 nkeep ; inline @@ -137,7 +139,7 @@ MACRO: multikeep ( word out-indexes -- ... ) [ drop ] rot compose attempt-all ; inline : do-while ( pred body tail -- ) - >r tuck 2slip r> while ; + >r tuck 2slip r> while ; inline : generate ( generator predicate -- obj ) [ dup ] swap [ dup [ nip ] unless not ] 3compose