]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/combinators/extras/extras.factor
factor: use ?call
[factor.git] / extra / combinators / extras / extras.factor
index a0a95b122f8aae44e2271e3e6ad135bcaf9251ad..eb69949e2d96c4b05c6ceb72470768ea7f7ac454 100644 (file)
@@ -87,17 +87,13 @@ MACRO: n*obj ( n obj -- quot )
 MACRO:: n-falsify ( n -- quot )
     [ n ndup n n-and [ n ndrop n f n*obj ] unless ] ;
 
-! plox
-: ?1res ( ..a obj/f quot -- ..b )
-    dupd when ; inline
-
 ! when both args are true, call quot. otherwise dont
 : ?2res ( ..a obj1 obj2 quot: ( obj1 obj2 -- ? ) -- ..b )
     [ 2dup and ] dip [ 2drop f ] if ; inline
 
 ! try the quot, keep the original arg if quot is true
 : ?1arg ( obj quot: ( obj -- ? ) -- obj/f )
-    [ ?1res ] keepd '[ _ ] [ f ] if ; inline
+    [ ?call ] keepd '[ _ ] [ f ] if ; inline
 
 : ?2arg ( obj1 obj2 quot: ( obj1 obj2 -- ? ) -- obj1/f obj2/f )
     [ ?2res ] 2keepd '[ _ _ ] [ f f ] if ; inline