]> gitweb.factorcode.org Git - factor.git/commitdiff
factor: use ?call
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 25 Feb 2023 15:08:13 +0000 (09:08 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 26 Feb 2023 23:11:04 +0000 (17:11 -0600)
basis/alien/libraries/finder/freebsd/freebsd.factor
basis/alien/libraries/libraries.factor
basis/cache/cache.factor
basis/cocoa/nibs/nibs.factor
basis/compiler/cfg/builder/alien/alien-tests.factor
basis/compiler/cfg/linear-scan/allocation/allocation.factor
basis/compiler/cfg/linear-scan/linear-scan-tests.factor
basis/compiler/cfg/linear-scan/live-intervals/live-intervals.factor
basis/compiler/cfg/ssa/construction/construction.factor
basis/compiler/codegen/gc-maps/gc-maps.factor
extra/combinators/extras/extras.factor

index 8523717cb65e8280504d304c9af468ec69847f63..b7c7bd19e259ce3e540fd87e4b9503aeeb51a3ec 100644 (file)
@@ -23,5 +23,5 @@ PRIVATE>
 
 M: freebsd find-library*
     "l" prepend load-ldconfig-cache
-    [ name-matches? ] with find nip ?first dup [ ".so" append ] when ;
+    [ name-matches? ] with find nip ?first [ ".so" append ] ?call ;
 
index 0c17e186f9d00b66e7244d50dfc4702b6bc838d5..5d6aee0a2886bfcc44b1033547869c08add25740 100644 (file)
@@ -41,7 +41,7 @@ GENERIC: library-dll ( obj -- dll )
 M: f library-dll ;
 
 M: library library-dll
-    dup [ dll>> ] when ;
+    [ dll>> ] ?call ;
 
 M: string library-dll ( library -- dll )
     lookup-library library-dll ;
index 09268d3e5b9da50b9c51dfaaf57dcf769d2d736e..ed502b47681024142be755b85b99ce943eba1c2a 100644 (file)
@@ -19,7 +19,7 @@ M: cache-entry dispose value>> dispose ;
 
 M: cache-assoc assoc-size assoc>> assoc-size ;
 
-M: cache-assoc at* assoc>> at* [ dup [ 0 >>age value>> ] when ] dip ;
+M: cache-assoc at* assoc>> at* [ [ 0 >>age value>> ] ?call ] dip ;
 
 M: cache-assoc set-at
     check-disposed
index 548dece51901629e02a232418c351c3782b3525d..9c051308b13008971001dbda3eecda8b1bb9b5d7 100644 (file)
@@ -11,7 +11,7 @@ IN: cocoa.nibs
 
 : nib-named ( nib-name -- anNSNib )
     <NSString> NSNib -> alloc swap f -> initWithNibNamed:bundle:
-    dup [ -> autorelease ] when ;
+    [ -> autorelease ] ?call ;
 
 : nib-objects ( anNSNib -- objects/f )
     f
index 46eef2e0e5315e7a00cf334bd6ba3a0104382a31..dc88fa935cf89bca981aa3d2e958c2aa9454593f 100644 (file)
@@ -49,7 +49,7 @@ ${
 } [
     f f cdecl f "libc" "malloc" alien-invoke-params boa
     caller-linkage
-    dup [ path>> alien>native-string ] when
+    [ path>> alien>native-string ] ?call
 ] unit-test
 
 SYMBOL: foo
index f3f48beed20fcfc324dbc23035333d5167b74093..aa980dfe0a36c21b7bcd23d4b9bc79b464273334 100644 (file)
@@ -35,7 +35,7 @@ IN: compiler.cfg.linear-scan.allocation
 : spill-at-sync-point? ( sync-point live-interval -- ? )
     {
         [ drop keep-dst?>> not ]
-        [ [ n>> ] dip find-use dup [ def-rep>> ] when not ]
+        [ [ n>> ] dip find-use [ def-rep>> ] ?call not ]
     } 2|| ;
 
 : spill-at-sync-point ( sync-point live-interval -- ? )
index a20bff465b113a3ee2b27009892d9a223aa9b150..8438faa597c1d58f1995a3e7ebd567c4ecdb26e4 100644 (file)
@@ -64,7 +64,7 @@ H{
 } representations set
 
 : clean-up-split ( a b -- a b )
-    [ dup [ [ >vector ] change-uses [ >vector ] change-ranges ] when ] bi@ ;
+    [ [ [ >vector ] change-uses [ >vector ] change-ranges ] ?call ] bi@ ;
 
 {
     T{ live-interval-state
index 3cede64e85e91b02ba896730098ecc98a6d4cf8f..88d5cb443277b1756c23a7206744eb817068737a 100644 (file)
@@ -37,7 +37,7 @@ TUPLE: live-interval-state
 
 :: find-use ( insn# live-interval -- vreg-use/f )
     insn# live-interval (find-use)
-    dup [ dup n>> insn# = [ drop f ] unless ] when ;
+    [ dup n>> insn# = [ drop f ] unless ] ?call ;
 
 : <live-interval> ( vreg -- live-interval )
     \ live-interval-state new
index 0bec5cebcb4c64ece96d49d81f9df495e9183c34..6cb69d90836030a115303c902905fae88da05051 100644 (file)
@@ -71,7 +71,7 @@ SYMBOLS: stacks pushed ;
 
 : top-name ( vreg -- vreg' )
     (top-name)
-    dup [ dup used-vregs get push-front ] when ;
+    [ dup used-vregs get push-front ] ?call ;
 
 RENAMING: ssa-rename [ gen-name ] [ top-name ] [ ]
 
index e373aa0745989b104d0e5108ef43ca06cc29e031..abfe6fa6edfb26225ea3c59ade1acbcfabff666d 100644 (file)
@@ -8,7 +8,7 @@ IN: compiler.codegen.gc-maps
 SYMBOLS: return-addresses gc-maps ;
 
 : gc-map-needed? ( gc-map/f -- ? )
-    dup [ tuple-slots [ empty? ] all? not ] when ;
+    [ tuple-slots [ empty? ] all? not ] ?call ;
 
 : gc-map-here ( gc-map -- )
     dup gc-map-needed? [
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