]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/interpolate/interpolate.factor
factor: use more ?if
[factor.git] / basis / interpolate / interpolate.factor
index 1c08e878fa4f1c46bb90cedfe2c0a80c0a97cd2c..59024ff90d35cf4b54956c1bae0860e1631212d3 100644 (file)
@@ -21,9 +21,10 @@ TUPLE: anon-var ;
             [
                 "}" split1-slice
                 [
-                    >string dup string>number
+                    >string
+                    [ string>number ]
                     [ 1 + stack-var boa ]
-                    [ [ anon-var new ] [ named-var boa ] if-empty ] ?if-old ,
+                    [ [ anon-var new ] [ named-var boa ] if-empty ] ?if ,
                 ]
                 [ (parse-interpolate) ] bi*
             ] when*
@@ -77,7 +78,7 @@ MACRO: interpolate ( str -- quot )
     [ interpolate ] with-string-writer ; inline
 
 : interpolate-locals-quot ( str -- quot )
-    [ dup search [ [ ] ] [ [ get ] ] ?if-old ] (interpolate-quot) ;
+    [ [ search ] [ [ ] ] [ [ get ] ] ?if ] (interpolate-quot) ;
 
 MACRO: interpolate-locals ( str -- quot )
     interpolate-locals-quot ;