]> gitweb.factorcode.org Git - factor.git/commitdiff
factor: use new words
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 21 Jul 2022 06:52:08 +0000 (01:52 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 31 Jul 2022 18:24:58 +0000 (13:24 -0500)
49 files changed:
basis/alien/libraries/finder/linux/linux-tests.factor
basis/alien/libraries/finder/linux/linux.factor
basis/alien/libraries/finder/macosx/macosx-tests.factor
basis/alien/libraries/finder/macosx/macosx.factor
basis/alien/libraries/finder/windows/windows-tests.factor
basis/base64/base64.factor
basis/bootstrap/compiler/compiler.factor
basis/cocoa/application/application.factor
basis/compiler/cfg/builder/builder-tests.factor
basis/compiler/cfg/checker/checker.factor
basis/compiler/cfg/stacks/local/local-tests.factor
basis/compiler/tree/dead-code/dead-code-tests.factor
basis/compiler/tree/propagation/propagation-tests.factor
basis/compiler/tree/recursive/recursive-tests.factor
basis/db/sqlite/sqlite.factor
basis/dns/dns.factor
basis/fixups/fixups.factor
basis/grouping/grouping.factor
basis/help/html/html.factor
basis/help/lint/checks/checks.factor
basis/help/lint/spaces/spaces.factor
basis/help/search/search.factor
basis/html/templates/fhtml/fhtml.factor
basis/http/client/client-tests.factor
basis/io/buffers/buffers.factor
basis/math/matrices/matrices.factor
basis/multiline/multiline.factor
basis/quoted-printable/quoted-printable-tests.factor
basis/sequences/generalizations/generalizations.factor
basis/sorting/insertion/insertion.factor
basis/tools/hexdump/hexdump.factor
basis/tools/test/test-tests.factor
basis/ui/images/images.factor
extra/bittorrent/bittorrent.factor
extra/cli/git/git.factor
extra/codebase-analyzer/codebase-analyzer.factor
extra/gemini/cli/cli.factor
extra/html/parser/analyzer/analyzer.factor
extra/lint/lint.factor
extra/mason/git/git.factor
extra/mediawiki/api/api.factor
extra/metar/metar.factor
extra/modern/slices/slices.factor
extra/rosetta-code/text-processing/max-licenses/max-licenses.factor
extra/rosetta-code/web-scraping/web-scraping.factor
extra/sequences/extras/extras.factor
extra/stack-as-data/stack-as-data.factor
extra/txon/txon.factor
extra/zoneinfo/zoneinfo.factor

index 261ecaadb5786e8c77d9ef39cffcabf4f39344b9..b26947f9c96826c4261caa7dd87661ead6c43797 100644 (file)
@@ -1,4 +1,4 @@
 USING: alien.libraries.finder sequences tools.test ;
 
-{ t } [ "libm.so" "m" find-library subseq? ] unit-test
-{ t } [ "libc.so" "c" find-library subseq? ] unit-test
+{ t } [ "m" find-library "libm.so" find-subseq? ] unit-test
+{ t } [ "c" find-library "libc.so" find-subseq? ] unit-test
index 835cc54666db045831232efa1386f323b910289f..cedd58cb846d8c14aef8002d1aad645f07be3514 100644 (file)
@@ -20,7 +20,7 @@ CONSTANT: mach-map {
         [
             " " split1 [ "()" in? ] trim "," split
             [ [ unicode:blank? ] trim ] map
-            [ ": Linux" swap subseq? ] reject
+            [ ": Linux" find-subseq? ] reject
         ] dip 3array
     ] map ;
 
@@ -50,7 +50,7 @@ CONSTANT: mach-map {
             "ld" , "-t" , ":" split [ "-L" , , ] each
             "-o" , "/dev/null" , "-l" name append ,
         ] { } make utf8 [ read-lines ] with-process-reader* 2drop
-        "lib" name append '[ _ swap subseq? ] find nip
+        "lib" name append '[ _ find-subseq? ] find nip
     ] [ f ] if* ;
 
 PRIVATE>
index 83d65e8f3481dc196228276148234263250fb574..a37425ded467de0937a3725ceaccd4949ab85085 100644 (file)
@@ -41,7 +41,7 @@ alien.libraries.finder.macosx.private sequences tools.test ;
     } [ dyld-find ] map
 ] unit-test
 
-{ t } [ "libm.dylib" "m" find-library subseq? ] unit-test
-{ t } [ "libc.dylib" "c" find-library subseq? ] unit-test
-{ t } [ "libbz2.dylib" "bz2" find-library subseq? ] unit-test
-{ t } [ "AGL.framework" "AGL" find-library subseq? ] unit-test
+{ t } [ "m" find-library "libm.dylib" find-subseq? ] unit-test
+{ t } [ "c" find-library "libc.dylib" find-subseq? ] unit-test
+{ t } [ "bz2" find-library "libbz2.dylib" find-subseq? ] unit-test
+{ t } [ "AGL" find-library "AGL.framework" find-subseq? ] unit-test
index 0ff1c8457ab8f392714f9da8611d7460a81c4461..d5913c85de64ae9b1ef7a1ba272b6c836e888565 100644 (file)
@@ -130,7 +130,7 @@ PRIVATE>
 
 : framework-find ( name -- path )
     dup dyld-find [ nip ] [
-        ".framework" over subseq-start [
+        dup ".framework" find-subseq [
             dupd head
         ] [
             [ ".framework" append ] keep
index d0fb21fa2a9b86f35a71a58dc9a3ef806ea94fbd..741f4375cbb111dcb3ea60ca3d8056a4204ee53d 100644 (file)
@@ -1,3 +1,3 @@
 USING: alien.libraries.finder sequences tools.test ;
 
-{ t } [ "kernel32.dll" "kernel32" find-library subseq? ] unit-test
+{ t } [ "kernel32" find-library "kernel32.dll" find-subseq? ] unit-test
index a85768aafe76140afaf85b561e8d005c75217ff1..38016ed41759fbc45a787073bf716ce75ad6642e 100644 (file)
@@ -77,7 +77,7 @@ PRIVATE>
 <PRIVATE
 
 : read1-ignoring ( ignoring stream -- ch )
-    dup stream-read1 pick dupd member-eq?
+    dup stream-read1 pick over member-eq-of?
     [ drop read1-ignoring ] [ 2nip ] if ; inline recursive
 
 : read-ignoring ( n ignoring stream -- accum )
index 80ed054bcf3ca18ca0c8c07c62b7326bfca858b8..e28bf818faeff290c3d50d220100ef52b164e5d0 100644 (file)
@@ -89,8 +89,8 @@ gc
     "." write flush
 
     {
-        member-eq? split harvest sift cut cut-slice subseq-start index clone
-        set-at reverse push-all class-of number>string string>number
+        member-eq? split harvest sift cut cut-slice subseq-start find-subseq
+        index clone set-at reverse push-all class-of number>string string>number
         like clone-like
     } compile-unoptimized
 
index 86cd1779169a3dcd6362773b3b8629d6a9bf5cee..9b485af8a04911f1533a21664c9c1726cc9f3b62 100644 (file)
@@ -40,9 +40,8 @@ FUNCTION: void NSBeep ( )
 
 : running.app? ( -- ? )
     ! Test if we're running a .app.
-    ".app"
     NSBundle -> mainBundle -> bundlePath CF>string
-    subseq? ;
+    ".app" tail? ;
 
 : assert.app ( message -- )
     running.app? [
index f0636006d3ddef124ecdd791a30788116b27bb15..0815040fd7e3891d4300e19371e8dc50086d1294 100644 (file)
@@ -90,7 +90,7 @@ IN: compiler.cfg.builder.tests
     [ { array } declare dup 1 slot [ 1 slot ] when ]
     [ [ dup more? ] [ dup ] produce ]
     [ vector new over test-case-1 [ test-case-2 ] [ ] if ]
-    [ [ [ nth-unsafe ".." = 0 ] dip set-nth-unsafe ] 2curry (each-integer) ]
+    [ [ [ nth-unsafe ".." = 0 ] dip set-nth-unsafe ] 2curry each-integer-from ]
     [
         { fixnum sbuf } declare 2dup 3 slot fixnum> [
             over 3 fixnum* over dup [ 2 slot resize-string ] dip 2 set-slot
index 23c5b25b6de05e55870475e016ee68766b5ca00e..0330d85b67aba6e379b219006a33226094fff3f3 100644 (file)
@@ -6,7 +6,7 @@ IN: compiler.cfg.checker
 ERROR: bad-successors ;
 
 : check-successors ( bb -- )
-    dup successors>> [ predecessors>> member-eq? ] with all?
+    dup successors>> '[ _ predecessors>> member-eq-of? ] all?
     [ bad-successors ] unless ;
 
 : check-cfg ( cfg -- )
index 83135d186dcde7bb8ad2401d06ad27fc93facc39..d12de4370649b280ef3fceaad7d2329f364c4f2c 100644 (file)
@@ -178,4 +178,4 @@ IN: compiler.cfg.stacks.local.tests
         my-new-key4
         set-slot
     ]
-    curry (each-integer) ;
+    curry each-integer-from ;
index 8812802b4c915c18a9309adee7e55be75ca64550..07394ecede394d8e9f85b54a01573716c120cefc 100644 (file)
@@ -167,7 +167,7 @@ IN: compiler.tree.dead-code.tests
 
 { } [ [ call-recursive-dce-5 swap ] optimize-quot drop ] unit-test
 
-{ } [ [ [ 0 -rot set-nth-unsafe ] curry (each-integer) ] optimize-quot drop ] unit-test
+{ } [ [ [ 0 -rot set-nth-unsafe ] curry each-integer-from ] optimize-quot drop ] unit-test
 
 : call-recursive-dce-6 ( i quot: ( ..a -- ..b ) -- i )
     dup call [ drop ] [ call-recursive-dce-6 ] if ; inline recursive
index 52016efa8794069babd92a556ff99ce283019bbc..b346b36736251f59bf9f9b44ae4005c2b52bf0bb 100644 (file)
@@ -726,7 +726,7 @@ TUPLE: mixed-mutable-immutable { x integer } { y sequence read-only } ;
 { } [ [ [ ] [ ] compose curry call ] final-info drop ] unit-test
 
 { V{ } } [
-    [ [ drop ] [ drop ] compose curry (each-integer) ] final-classes
+    [ [ drop ] [ drop ] compose curry each-integer-from ] final-classes
 ] unit-test
 
 GENERIC: iterate ( obj -- next-obj ? )
index ce69216cfc6757a32f9e819911176844e9045d6a..ba029034e70462f5e9866e581071df29031082a2 100644 (file)
@@ -51,7 +51,7 @@ IN: compiler.tree.recursive.tests
 
 { t } [
     [ [ loop-test-1 ] each ] build-tree analyze-recursive
-    \ (each-integer) label-is-loop?
+    \ each-integer-from label-is-loop?
 ] unit-test
 
 : loop-test-2 ( a b -- a' )
@@ -175,7 +175,7 @@ DEFER: a''
 { t } [
     [ 10 [ [ drop ] each-integer ] loop-in-non-loop ]
     build-tree analyze-recursive
-    \ (each-integer) label-is-loop?
+    \ each-integer-from label-is-loop?
 ] unit-test
 
 DEFER: a'''
index b581a500588a620e9b80c011a3ee7a08892d21fe..046e662f5cf3ef2a21b133d2d0799f2e58a9db3b 100644 (file)
@@ -260,7 +260,7 @@ M: sqlite-db-connection persistent-table
     "sql-spec" get modifiers>> [ +not-null+ = ] none? ;
 
 : delete-cascade? ( -- ? )
-    "sql-spec" get modifiers>> { +on-delete+ +cascade+ } swap subseq? ;
+    "sql-spec" get modifiers>> { +on-delete+ +cascade+ } find-subseq? ;
 
 : sqlite-trigger, ( string -- )
     { } { } <simple-statement> 3, ;
index c6bcfb37ad48bf9fbd18536428472eec35738c43..2cb75d9eb8b38a4249baf8f6a4bb41500370fb7e 100644 (file)
@@ -58,7 +58,7 @@ SYMBOL: dns-servers
 ERROR: domain-name-contains-empty-label domain ;
 
 : check-domain-name ( domain -- domain )
-    ".." over subseq? [ domain-name-contains-empty-label ] when ;
+    dup ".." find-subseq? [ domain-name-contains-empty-label ] when ;
 
 : >dotted ( domain -- domain' )
     dup "." tail? [ "." append ] unless ;
index d7c70b66345917599e541a34a012801b4620804f..77b3ca7458dff353b5462d86b833c3e375223184 100644 (file)
@@ -42,6 +42,9 @@ CONSTANT: word-renames {
     { "git-checkout-existing-branch" { "git-checkout-existing" "0.99" } }
     { "git-checkout-existing-branch*" { "git-checkout-existing*" "0.99" } }
     { "tags" { "chloe-tags" "0.99" } }
+    { "(each-integer)" { "each-integer-from" "0.99" } }
+    { "(find-integer)" { "find-integer-from" "0.99" } }
+    { "(all-integers?)" { "all-integers-from?" "0.99" } }
 }
 
 : compute-assoc-fixups ( continuation name assoc -- seq )
index 49890180e03d166d1227714629ca84c7cb94f05e..43916ab8d9a4a2adc48e6763b03fdcbe42c2e5cf 100644 (file)
@@ -75,7 +75,7 @@ PRIVATE>
             [ first2-unsafe ] dip call
         ] [
             [ [ first-unsafe 1 ] [ setup-each [ + ] 2dip ] bi ] dip
-            '[ @ _ keep swap ] (all-integers?) nip
+            '[ @ _ keep swap ] all-integers-from? nip
         ] if
     ] if ; inline
 
index b5ee48c8eb13f33a041da44b05f0dd6b9207d5a7..fd885b22cfe9797731e04da5028ba6386104fd94 100644 (file)
@@ -140,17 +140,17 @@ M: pathname url-of
         " white-space: pre-wrap; line-height: 125%;" append
     ] re-replace-with
 
-   { "font-family: monospace;" "background-color:" } [ over subseq? ] all? [
-       " margin: 10px 0px;" append
-   ] when
+    { "font-family: monospace;" "background-color:" } [ find-subseq? ] with all?[
+        " margin: 10px 0px;" append
+    ] when
 
-    { "border:" "background-color:" } [ over subseq? ] all? [
+    dup { "border:" "background-color:" } [ find-subseq? ] with all? [
         " border-radius: 5px;" append
     ] when ;
 
 : fix-help-header ( classes -- classes )
     dup [
-        [ ".a" head? ] [ "#f4efd9;" swap subseq? ] bi and
+        [ ".a" head? ] [ "#f4efd9;" find-subseq? ] bi and
     ] find [
         "padding: 10px;" "padding: 0px;" replace
         "background-color: #f4efd9;" "background-color: white;" replace
@@ -188,7 +188,7 @@ M: pathname url-of
                 ] re-replace-with
             ] map " " join "{ " " }" surround
         ] re-replace-with "    " prepend
-        "{  }" over subseq? [ drop f ] when
+        dup "{  }" find-subseq? [ drop f ] when
     ] map harvest append "}" suffix ;
 
 : css-classes ( classes -- stylesheet )
@@ -215,7 +215,7 @@ M: pathname url-of
     ] each classes sort-values css-classes body ;
 
 : retina-image ( path -- path' )
-    "@2x" over subseq? [ "." split1-last "@2x." glue ] unless ;
+    dup "@2x" find-subseq? [ "." split1-last "@2x." glue ] unless ;
 
 : ?copy-file ( from to -- )
     dup file-exists? [ 2drop ] [ copy-file ] if ;
index 6c994e01012baebb3f1209db5b80aae79d7078e4..fc2b6b94062a704704621beedfb318284bdc68f1 100644 (file)
@@ -152,7 +152,7 @@ SYMBOL: vocab-articles
             simple-lint-error
         ] when
     ] [
-        "  " swap subseq? [
+        "  " find-subseq? [
             "Paragraph text should not contain double spaces"
             simple-lint-error
         ] when
index 7032f7bd228190047183b6a531794b7c8ce6916f..3419b029d51fcc5fa392eb5f41b5361392db0dc0 100644 (file)
@@ -18,7 +18,7 @@ IN: help.lint.spaces
             first [
                 { [ CHAR: space = ] [ CHAR: " = ] } 1||
             ] trim-head
-            "  " swap subseq?
+            "  " find-subseq?
         ] filter
         [ drop ] [
             swap <pathname> .
index 3ed9b2f08b757c23d2bc814c0897b26e4d387ffd..39103580254511cc7430e0086be607a5470cf262 100644 (file)
@@ -37,7 +37,7 @@ MEMO: article-words ( name -- words )
     search-words [ { } ] [
         [ all-articles ] dip
         dup length 1 > [
-            '[ article-words _ swap subseq? ] filter
+            '[ article-words _ find-subseq? ] filter
         ] [
             first '[ article-words [ _ head? ] any? ] filter
         ] if
index cac7b39f0bfd7aede7f03611a59d5336ac48f74b..40189add6d87590b395699536262b147bc515d0e 100644 (file)
@@ -23,7 +23,7 @@ M: template-lexer skip-word
 DEFER: <% delimiter
 
 : check-<% ( lexer -- col )
-    "<%" swap [ line-text>> ] [ column>> ] bi subseq-start-from ;
+    [ column>> ] [ line-text>> ] bi "<%" find-subseq-from ;
 
 : found-<% ( accum lexer col -- accum )
     [
index d139ad7b6ad3f79a5323ae6f407a95f8f1d3db0f..aec8f2041f909fba07c8110917dc3d548cca870d 100644 (file)
@@ -48,8 +48,8 @@ IN: http.client.tests
 ! hit the velox.ch website.
 ! { t } [
     ! "https://alice.sni.velox.ch" http-get nip
-    ! [ "Great!" swap subseq? ]
-    ! [ "TLS SNI Test Site: alice.sni.velox.ch" swap subseq? ] bi and
+    ! [ "Great!" find-subseq? ]
+    ! [ "TLS SNI Test Site: alice.sni.velox.ch" find-subseq? ] bi and
 ! ] unit-test
 
 { t } [
index 72d7f4c474a778c78101f5fae0f571a3e2f1ef2c..16fd7439764ace84345803d425a51e23c9f600cf 100644 (file)
@@ -80,7 +80,7 @@ TYPED: buffer-find ( seps buffer: buffer -- n/f )
     [
         swap [ [ pos>> ] [ fill>> ] [ ptr>> ] tri ] dip
         [ swap alien-unsigned-1 ] [ member-eq? ] bi-curry*
-        compose (find-integer)
+        compose find-integer-from
     ] [
         [ pos>> - ] curry [ f ] if*
     ] bi ; inline
index 68cbfa4414f8b9d66e6394b52259e1e9a43e9f91..cfbee2962cc5b7a92314ea57908036f80d6d72dc 100644 (file)
@@ -122,7 +122,7 @@ ALIAS: transpose flip
 
 : unshaped-cols-iota ( matrix -- cols-iota )
   [ first-unsafe length ] keep
-  [ length min ] 1 (each-from) (each-integer) <iota> ; inline
+  [ length min ] 1 (each-from) each-integer-from <iota> ; inline
 
 : generic-anti-transpose-unsafe ( cols-iota matrix -- newmatrix )
     [ <reversed> [ nth-end-unsafe ] with { } map-as ] curry { } map-as ; inline
index d984095dfe355d60a7ab2cf0b278e4282e013c68..bc5e8a45553c52b0aca0709f394af7ab991e6447 100644 (file)
@@ -41,7 +41,7 @@ SYNTAX: STRING:
 :: (scan-multiline-string) ( i end lexer -- j )
     lexer line-text>> :> text
     lexer still-parsing? [
-        end text i subseq-start-from [| j |
+        i text end find-subseq-from [| j |
             i j text subseq % j end length +
         ] [
             text i short tail % CHAR: \n ,
index b500212ce1a9585ebbee055b136e93fddc52c419..f57f2f0a1ab4900622123926aa68540916081595 100644 (file)
@@ -23,8 +23,8 @@ and we didn't know hów tö do thât" latin2 encode >quoted ] unit-test
 : message ( -- str )
     55 [ "hello" ] replicate concat ;
 
-{ f } [ message >quoted "=\r\n" swap subseq? ] unit-test
+{ f } [ message >quoted "=\r\n" find-subseq? ] unit-test
 { 1 } [ message >quoted split-lines length ] unit-test
-{ t } [ message >quoted-lines "=\r\n" swap subseq? ] unit-test
+{ t } [ message >quoted-lines "=\r\n" find-subseq? ] unit-test
 { 4 } [ message >quoted-lines split-lines length ] unit-test
 { "===o" } [ message >quoted-lines split-lines [ last ] "" map-as ] unit-test
index afab0b3217ca42cc0255acb9cee81a9c873f6d54..415ec8880066b16a99363f73abec39b38cbd0f77 100644 (file)
@@ -124,7 +124,7 @@ MACRO: (ncollect) ( n -- quot )
 MACRO: nmap-reduce ( map-quot reduce-quot n -- quot )
     -rot dupd compose overd over '[
         [ [ first ] _ napply @ 1 ] _ nkeep
-        _ _ (neach) (each-integer)
+        _ _ (neach) each-integer-from
     ] ;
 
 : nall? ( seqs... quot n -- ? )
index 2a2ac4134a1e527d4892a26c0e22d790bdbf0266..425b547dd895e4a785d26811be218d485f011571 100644 (file)
@@ -16,4 +16,4 @@ PRIVATE>
 
 : insertion-sort ( ... seq quot: ( ... elt -- ... elt' ) -- ... )
     ! quot is a transformation on elements
-    over length [ insert ] 2with 1 -rot (each-integer) ; inline
+    over length [ insert ] 2with 1 -rot each-integer-from ; inline
index c5bb93a7c937efa398f698bbdc1eed0ace77619a..feaa8c542cf4da4907be4e2cd09b897610b3f685 100644 (file)
@@ -35,7 +35,7 @@ CONSTANT: hex-digits $[
     [ 0 swap length ] keep ; inline
 
 : each-byte ( from to bytes quot: ( elt -- ) -- )
-    '[ _ nth-unsafe @ ] (each-integer) ; inline
+    '[ _ nth-unsafe @ ] each-integer-from ; inline
 
 : write-bytes ( from to bytes stream -- )
     '[ hex-digits nth-unsafe _ stream-write ] each-byte ; inline
index fd51d8af8be899ca14e9d2301f7bb10328112995..50e36d44719c23a53f21cd9c5316e987f81130a4 100644 (file)
@@ -16,5 +16,5 @@ sequences tools.test tools.test.private ;
 ! Just verifies that the presented output contains a callstack.
 { t } [
     create-test-failure [ error. ] with-string-writer
-    "OBJ-CURRENT-THREAD" swap subseq?
+    "OBJ-CURRENT-THREAD" find-subseq?
 ] unit-test
index 79ea0a869190cf652f105e8a6300b0f8be8660b1..b11520e390ff21a5bd93e5b26ab8f075a231a5ce 100644 (file)
@@ -12,7 +12,7 @@ C: <image-name> image-name
 <PRIVATE
 
 MEMO: cached-image-path ( path -- image )
-    [ load-image ] [ "@2x" swap subseq? >>2x? ] bi ;
+    [ load-image ] [ "@2x" find-subseq? >>2x? ] bi ;
 
 PRIVATE>
 
index 1509788e66be80368a3f30ec01be05521f575455..1564022d9b1af9a939c34ca57c311002f3a5c7c8 100644 (file)
@@ -73,7 +73,7 @@ M: string load-metainfo
     dup "announce-list" of [ nip first random ] [ "announce" of ] if* ;
 
 : scrape-url ( metainfo -- url/f )
-    announce-url "announce" over path>> subseq? [
+    announce-url dup path>>  "announce" find-subseq? [
         [ "announce" "scrape" replace ] change-path
     ] [ drop f ] if ;
 
@@ -425,7 +425,7 @@ M: peer dispose
 :: next-block ( peer -- peer )
     peer current-index>> [ 1 + ] [ 0 ] if*
     peer #pieces>>
-    peer bitfield>> '[ _ check-bitfield ] (find-integer)
+    peer bitfield>> '[ _ check-bitfield ] find-integer-from
     peer current-index<<
     0 peer current-piece>> set-length
     peer ;
index 22b59f2312e3b30bfd1c2a346ce5cbf445802107..5a431c3e12bafb5b9bcf68202e9cb75b0d1ada83 100644 (file)
@@ -63,4 +63,4 @@ cli-git-num-parallel [ cpus 2 * ] initialize
 
 : directory-entries-without-git ( directory -- entries )
     recursive-directory-entries
-    [ name>> "/.git/" swap subseq? ] reject ;
\ No newline at end of file
+    [ name>> "/.git/" find-subseq? ] reject ;
\ No newline at end of file
index 0680d6b41bcc859292b038adf4d1633f653199f3..55e3a2ac1cb556896a138f99c8b2ad8ce2f2ba06 100644 (file)
@@ -23,10 +23,10 @@ IN: codebase-analyzer
     [ has-file-extension? ] filter ;
 
 : without-git-paths ( paths -- paths' )
-    [ "/.git/" swap subseq? ] reject ;
+    [ "/.git/" find-subseq? ] reject ;
 
 : without-node-modules-paths ( paths -- paths' )
-    [ "/node_modules/" swap subseq? ] reject ;
+    [ "/node_modules/" find-subseq? ] reject ;
 
 : regular-directory-files ( path -- seq )
     recursive-directory-files
index 9243475bd3c5c83f4c60b5ccfc7884f39e7b80b0..a59cfe68bc759c97b1910c6074a3c4b7e712c8cd 100644 (file)
@@ -101,7 +101,7 @@ CONSTANT: URL V{ }
 
 : gemini-go ( args -- )
     present [ DEFAULT-URL ] when-empty
-    { [ "://" over subseq? ] [ "gemini://" head? ] } 1||
+    { [ dup "://" find-subseq? ] [ "gemini://" head? ] } 1||
     [ "gemini://" prepend ] unless
     dup "gemini://" head? [
         [ add-history ] [ add-stack ] [ gemini-get ] tri
index 43b859d61851327bd0fcd34c183e64695dd25418..6fd88ddbdcec9e2cd90999c78065e84c9bea9b96 100644 (file)
@@ -142,7 +142,7 @@ ERROR: undefined-find-nth m n seq quot ;
     [ { [ name>> = ] [ closing?>> not ] } 1&& ] with find-all ;
 
 : href-contains? ( str tag -- ? )
-    "href" attribute* [ subseq? ] [ 2drop f ] if ;
+    "href" attribute* [ swap find-subseq? ] [ 2drop f ] if ;
 
 : find-hrefs ( vector -- vector' )
     [ { [ name>> "a" = ] [ "href" attribute? ] } 1&& ] filter sift
index 4b754ef42ea26bfc0f2e18a184c6945ced84489f..53ef1f453efd035fbf353eddd93a7f65893ceda3 100644 (file)
@@ -249,7 +249,7 @@ GENERIC: lint ( obj -- seq )
 M: object lint ( obj -- seq ) drop f ;
 
 M: callable lint ( quot -- seq )
-    [ lint-definitions-keys get-global ] dip '[ _ subseq? ] filter ;
+    lint-definitions-keys get-global [ find-subseq? ] with filter ;
 
 M: word lint ( word -- seq/f )
     def>> [ callable? ] deep-filter [ lint ] map concat ;
index 19d522f1e90930c3725dc032ba2a291865b874cf..8bc24c406d38521c18f4682b9dd0551c1fe28a9c 100644 (file)
@@ -47,7 +47,7 @@ IN: mason.git
 
 : git-pull-failed ( error -- )
     dup output-process-error? [
-        dup output>> "not uptodate. Cannot merge." swap subseq?
+        dup output>> "not uptodate. Cannot merge." find-subseq?
         [ git-repo-corrupted ]
         [ rethrow ]
         if
index 03e84725948623e7f475c61166bea4bd45eb44e1..9e6ce829c736bb6b0774f9e5dbd9f33c5e92f8cc 100644 (file)
@@ -104,7 +104,7 @@ t botflag set-global
 : nonce-already-used? ( assoc -- ? )
     "error" of
     [ "code" of "mwoauth-invalid-authorization" = ]
-    [ "info" of "Nonce already used" swap subseq-start ] bi
+    [ "info" of "Nonce already used" find-subseq ] bi
     and ;
 
 : readonly? ( assoc -- ? )
index 5a740a025dac215551db7b0aac39a80b72dd7325..d88249050352269fb03fd8e07b3c4546f37d4291 100644 (file)
@@ -282,7 +282,7 @@ CONSTANT: compass-directions H{
     ] if ;
 
 : parse-weather ( str -- str' )
-    "VC" over subseq? [ "VC" "" replace t ] [ f ] if
+    dup "VC" find-subseq? [ "VC" "" replace t ] [ f ] if
     [ (parse-weather) ]
     [ [ " in the vicinity" append ] when ] bi* ;
 
index 54b90c8472aacfd35d3245b45b8c7b9eb13fa337..001c4e1ad6b043a0a49278080db707ef792f0343 100644 (file)
@@ -182,7 +182,7 @@ ERROR: expected-sequence-error expected actual ;
 ERROR: subseq-expected-but-got-eof n string expected ;
 
 :: slice-til-string ( n string search --  n' string payload end-string )
-    search string n subseq-start-from :> n'
+    n string search find-subseq-from :> n'
     n' [ n string search subseq-expected-but-got-eof ] unless
     n' search length + string
     n n' string ?<slice>
@@ -206,8 +206,8 @@ ERROR: subseq-expected-but-got-eof n string expected ;
 : rewind-slice ( n string slice -- n' string )
     2nip [ from>> ] [ seq>> ] bi ; inline
 
-:: take-from? ( n seq subseq -- n'/f seq  ? )
-    subseq seq n pick length (subseq-start-from) 2nip [
+:: take-from? ( n seq subseq -- n'/f seq ? )
+    n seq subseq subseq-starts-at? [
         n subseq length +
         seq
         t
index 602d44e7b9735a0abd716d632fbae11507213f91..2b875f97266fa4128cd0299aa9f244235192cfa6 100644 (file)
@@ -32,7 +32,7 @@ TUPLE: maxlicense max-count current-count times ;
 
 : <maxlicense> ( -- max ) -1 0 V{ } clone \ maxlicense boa ; inline
 
-: out? ( line -- ? ) [ "OUT" ] dip subseq? ; inline
+: out? ( line -- ? ) "OUT" find-subseq? ; inline
 
 : line-time ( line -- time ) split-words harvest fourth ; inline
 
index c44ef62554227e086c8f199df237cda4138ca5a9..1a426f9a110e003c5550c12ecff9af31b4a5e9ab 100644 (file)
@@ -16,6 +16,6 @@ IN: rosetta-code.web-scraping
 
 : web-scraping-main ( -- )
     "http://tycho.usno.navy.mil/cgi-bin/timer.pl" http-get nip
-    [ "UTC" swap subseq-start [ 9 - ] [ 1 - ] bi ] keep subseq print ;
+    [ "UTC" find-subseq [ 9 - ] [ 1 - ] bi ] keep subseq print ;
 
 MAIN: web-scraping-main
index 9d6de7a958e89ad742c4b9844b27ccd9509d280a..334f352638b644641614146b6fba3c7d2eb40a82 100644 (file)
@@ -315,7 +315,7 @@ PRIVATE>
 
 : 3each-from
     ( ... seq1 seq2 seq3 quot: ( ... elt1 elt2 elt3 -- ... ) i -- ... )
-    [ (3each) ] dip -rot (each-integer) ; inline
+    [ (3each) ] dip -rot each-integer-from ; inline
 
 : 3map-reduce
     ( ..a seq1 seq2 seq3 map-quot: ( ..a elt1 elt2 elt3 -- ..b intermediate ) reduce-quot: ( ..b prev intermediate -- ..a next ) -- ..a result )
@@ -598,7 +598,7 @@ PRIVATE>
     [ length 1 - swap - ] [ nth ] bi ; inline
 
 : each-index-from ( ... seq quot: ( ... elt index -- ... ) i -- ... )
-    -rot (each-index) (each-integer) ; inline
+    -rot (each-index) each-integer-from ; inline
 
 <PRIVATE
 
@@ -655,7 +655,7 @@ PRIVATE>
 
 :: (start-all) ( seq subseq increment -- indices )
     0
-    [ [ subseq seq ] dip subseq-start-from dup ]
+    [ seq subseq find-subseq-from dup ]
     [ [ increment + ] keep ] produce nip ;
 
 : start-all ( seq subseq -- indices )
index 17cbc53feb8781aa56af3b96266ef0ddd91ce74c..fef8c564143d19f1a7ac92d2c8fe1ec6acc8d13c 100644 (file)
@@ -16,8 +16,5 @@ MACRO: stack-exchange ( m n -- quot )
     swapd
     '[ _ _ stack-set-nth _ _ stack-set-nth ] ;
 
-! MACRO: stack-filter ( n quot: ( obj -- ? ) -- quot' )
-!     selector [ '[ _ ] replicate spread ] dip ;
-
 MACRO: stack-map ( n quot: ( obj -- obj' ) -- quot' )
     '[ _ ] replicate '[ _ spread ] ;
index 7bdfcec510e144fb6b07facf0fd737f59745afaa..f681ef3c21d71952d053616145604807c5abbfc5 100644 (file)
@@ -42,7 +42,7 @@ DEFER: name/values
 
 : name=value ( string -- remain term )
     [ unicode:blank? ] trim
-    ":`" over subseq? [ (name=value) ] [ f swap ] if ;
+    dup ":`" find-subseq? [ (name=value) ] [ f swap ] if ;
 
 : name/values ( string -- remain terms )
     [ dup { [ empty? not ] [ first CHAR: ` = not ] } 1&& ]
index 834408aac3fe76f5e05d83be0009f64640bd8a41..5503f7bf961ea6e20794923a77f98b12cec0c766 100644 (file)
@@ -147,7 +147,7 @@ MEMO: zoneinfo-assoc ( -- assoc )
 
 : zoneinfo-zones ( -- seq )
     raw-zone-map keys
-    [ "/" swap subseq? ] partition
+    [ "/" find-subseq? ] partition
     [ natural-sort ] bi@ append ;
 
 GENERIC: zone-matches? ( string rule -- ? )
@@ -232,8 +232,8 @@ ERROR: unknown-day-abbrev day ;
 
 : comparison-day-string ( timestamp string -- timestamp )
     {
-        { [ ">=" over subseq? ] [ ">=" split1 swap [ string>number >>day ] dip day-abbrev>= ] }
-        { [ "<=" over subseq? ] [ "<=" split1 swap [ string>number >>day ] dip day-abbrev<= ] }
+        { [ dup ">=" find-subseq? ] [ ">=" split1 swap [ string>number >>day ] dip day-abbrev>= ] }
+        { [ dup "<=" find-subseq? ] [ "<=" split1 swap [ string>number >>day ] dip day-abbrev<= ] }
         [ string>number >>day ]
     } cond ;