]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/combinators/extras/extras.factor
core: Add the shuffler words but without primitives.
[factor.git] / extra / combinators / extras / extras.factor
index 274c0e860b4abf6d7e7a5b05b251f2dd20c7f416..3cd42feeb13215dcc4a82b3871aedc8039914080 100644 (file)
@@ -40,9 +40,6 @@ MACRO: cleave-array ( quots -- quot )
 : 4tri ( w x y z p q r -- )
     [ [ 4keep ] dip 4keep ] dip call ; inline
 
-: keepd ( ..a x y quot: ( ..a x y -- ..b ) -- ..b x )
-    2keep drop ; inline
-
 : plox ( ... x/f quot: ( ... x -- ... ) -- ... )
     dupd when ; inline
 
@@ -85,10 +82,10 @@ MACRO:: n-falsify ( n -- quot )
 
 ! try the quot, keep the original arg if quot is true
 : ?1arg ( obj quot: ( obj -- ? ) -- obj/f )
-    [ ?1res ] 2keep drop '[ _ ] [ f ] if ; inline
+    [ ?1res ] keepd '[ _ ] [ f ] if ; inline
 
 : ?2arg ( obj1 obj2 quot: ( obj1 obj2 -- ? ) -- obj1/f obj2/f )
-    [ ?2res ] 3keep drop '[ _ _ ] [ f f ] if ; inline
+    [ ?2res ] 2keepd '[ _ _ ] [ f f ] if ; inline
 
 <<
 : alist>quot* ( default assoc -- quot )