]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/combinators/lib/lib.factor
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / extra / combinators / lib / lib.factor
index f65b94dc115a680f86d04fdc1332794029880b98..99386272f39df4180a07f9cbbd4430e5ff60914f 100755 (executable)
@@ -169,5 +169,12 @@ MACRO: construct-slots ( assoc tuple-class -- tuple )
 : and? ( obj quot1 quot2 -- ? )
     >r keep r> rot [ call ] [ 2drop f ] if ; inline
 
+MACRO: multikeep ( word out-indexes -- ... )
+    [
+        dup >r [ \ npick \ >r 3array % ] each
+        %
+        r> [ drop \ r> , ] each
+    ] [ ] make ;
+
 : retry ( quot n -- )
     [ drop ] rot compose attempt-all ; inline