]> gitweb.factorcode.org Git - factor.git/commitdiff
vocabs.loader: use ?if
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 17 Feb 2023 04:22:23 +0000 (22:22 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 26 Feb 2023 23:11:04 +0000 (17:11 -0600)
core/memoize/memoize.factor
core/parser/parser.factor
core/strings/strings.factor
core/vocabs/loader/loader.factor

index 5eccc9d7dcb4528b1ae10af046bf171d6b1966f4..d5a09e3ab8c9479d8d97578d50d3e90f229965a1 100644 (file)
@@ -44,8 +44,9 @@ IN: memoize
 : make/0 ( table quot effect -- quot )
     out>> [
         packer '[
-            _ dup first-unsafe
-            [ ] [ @ @ [ 0 rot set-nth-unsafe ] keep ] ?if-old
+            _
+            [ first-unsafe ]
+            [ @ @ [ 0 rot set-nth-unsafe ] keep ] ?unless
         ]
     ] keep unpacker compose ;
 
index 50dcb3b3d3c9b97f287cf5d62684ddeac4be5a77..e483e0c8d49fe861d57fae1f89ce90b804aebfa1 100644 (file)
@@ -46,7 +46,7 @@ SYMBOL: auto-use?
     no-word-restarted ;
 
 : parse-word ( string -- word )
-    dup search [ ] [ no-word ] ?if-old ;
+    [ search ] [ no-word ] ?unless ;
 
 ERROR: number-expected ;
 
index b577aca722afc1667945e4ed58cf5c2bce7c5e94..a2ca75deeecb481361ccbd4608cd43332af9483f 100644 (file)
@@ -70,8 +70,8 @@ M: string equal?
 
 M: string hashcode*
     nip
-    dup string-hashcode
-    [ ] [ dup rehash-string string-hashcode ] ?if-old ;
+    [ string-hashcode ]
+    [ dup rehash-string string-hashcode ] ?unless ;
 
 M: string length
     length>> ; inline
index 113ed9a4a24b280f0008f7d9286b27b2a9aef245..458bfc401628d4c98a250541bf7e4fe5aaeff0a0 100644 (file)
@@ -148,13 +148,14 @@ PRIVATE>
     ] when* require ;
 
 : run ( vocab -- )
-    dup load-vocab vocab-main [
-        execute( -- ) ]
+    load-vocab
+    [ vocab-main ]
+    [ execute( -- ) ]
     [
         "The " write vocab-name write
         " vocabulary does not define an entry point." print
         "To define one, refer to \\ MAIN: help" print
-    ] ?if-old ;
+    ] ?if ;
 
 <PRIVATE