From 28f8cfe9fd4f17581ea380e09a3d0b107490146e Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sun, 31 Jul 2022 10:19:00 -0500 Subject: [PATCH] sequences: rename subsequence? words to subseq? again. --- .../libraries/finder/linux/linux-tests.factor | 4 ++-- .../alien/libraries/finder/linux/linux.factor | 4 ++-- .../finder/macosx/macosx-tests.factor | 8 ++++---- .../libraries/finder/macosx/macosx.factor | 2 +- .../finder/windows/windows-tests.factor | 2 +- basis/bootstrap/compiler/compiler.factor | 2 +- basis/compression/gzip/gzip.factor | 2 +- basis/db/sqlite/sqlite.factor | 2 +- basis/dns/dns.factor | 2 +- basis/fixups/fixups.factor | 2 +- basis/game/input/iokit/iokit.factor | 2 +- basis/help/html/html.factor | 10 +++++----- basis/help/lint/checks/checks.factor | 2 +- basis/help/lint/spaces/spaces.factor | 2 +- basis/help/search/search.factor | 2 +- basis/html/templates/fhtml/fhtml.factor | 2 +- basis/http/client/client-tests.factor | 4 ++-- basis/mime/multipart/multipart.factor | 9 ++++----- basis/models/search/search.factor | 2 +- basis/multiline/multiline.factor | 2 +- .../quoted-printable-tests.factor | 4 ++-- basis/sequences/deep/deep-tests.factor | 6 +++--- basis/sequences/deep/deep.factor | 4 ++-- basis/tools/test/test-tests.factor | 2 +- basis/ui/images/images.factor | 2 +- basis/urls/urls.factor | 2 +- core/sequences/sequences-docs.factor | 8 ++++---- core/sequences/sequences.factor | 13 +++++++----- core/splitting/splitting.factor | 2 +- core/strings/strings-tests.factor | 20 +++++++++---------- core/system/system-tests.factor | 2 +- extra/bittorrent/bittorrent.factor | 2 +- extra/cli/git/git.factor | 2 +- .../codebase-analyzer.factor | 4 ++-- extra/combinators/extras/extras-tests.factor | 10 +++++----- extra/gemini/cli/cli.factor | 2 +- extra/html/parser/analyzer/analyzer.factor | 2 +- extra/io/encodings/detect/detect.factor | 2 +- extra/lint/lint.factor | 2 +- extra/mason/git/git.factor | 2 +- extra/mediawiki/api/api.factor | 2 +- extra/metar/metar.factor | 2 +- extra/modern/slices/slices.factor | 2 +- extra/project-euler/047/047.factor | 2 +- .../rosetta-code/multisplit/multisplit.factor | 2 +- .../max-licenses/max-licenses.factor | 2 +- .../web-scraping/web-scraping.factor | 2 +- extra/sequences/extras/extras.factor | 2 +- extra/txon/txon.factor | 2 +- extra/zoneinfo/zoneinfo.factor | 6 +++--- 50 files changed, 93 insertions(+), 91 deletions(-) diff --git a/basis/alien/libraries/finder/linux/linux-tests.factor b/basis/alien/libraries/finder/linux/linux-tests.factor index a202743fc7..aad51a1067 100644 --- a/basis/alien/libraries/finder/linux/linux-tests.factor +++ b/basis/alien/libraries/finder/linux/linux-tests.factor @@ -1,4 +1,4 @@ USING: alien.libraries.finder sequences tools.test ; -{ t } [ "m" find-library "libm.so" subsequence? ] unit-test -{ t } [ "c" find-library "libc.so" subsequence? ] unit-test +{ t } [ "m" find-library "libm.so" subseq-index? ] unit-test +{ t } [ "c" find-library "libc.so" subseq-index? ] unit-test diff --git a/basis/alien/libraries/finder/linux/linux.factor b/basis/alien/libraries/finder/linux/linux.factor index d8698ac684..881d3f7e70 100644 --- a/basis/alien/libraries/finder/linux/linux.factor +++ b/basis/alien/libraries/finder/linux/linux.factor @@ -20,7 +20,7 @@ CONSTANT: mach-map { [ " " split1 [ "()" in? ] trim "," split [ [ unicode:blank? ] trim ] map - [ ": Linux" subsequence? ] reject + [ ": Linux" subseq-index? ] 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 '[ _ subsequence? ] find nip + "lib" name append '[ _ subseq-index? ] find nip ] [ f ] if* ; PRIVATE> diff --git a/basis/alien/libraries/finder/macosx/macosx-tests.factor b/basis/alien/libraries/finder/macosx/macosx-tests.factor index e79dbb8f6c..c8bd105ccb 100644 --- a/basis/alien/libraries/finder/macosx/macosx-tests.factor +++ b/basis/alien/libraries/finder/macosx/macosx-tests.factor @@ -41,7 +41,7 @@ alien.libraries.finder.macosx.private sequences tools.test ; } [ dyld-find ] map ] unit-test -{ t } [ "m" find-library "libm.dylib" subsequence? ] unit-test -{ t } [ "c" find-library "libc.dylib" subsequence? ] unit-test -{ t } [ "bz2" find-library "libbz2.dylib" subsequence? ] unit-test -{ t } [ "AGL" find-library "AGL.framework" subsequence? ] unit-test +{ t } [ "m" find-library "libm.dylib" subseq-index? ] unit-test +{ t } [ "c" find-library "libc.dylib" subseq-index? ] unit-test +{ t } [ "bz2" find-library "libbz2.dylib" subseq-index? ] unit-test +{ t } [ "AGL" find-library "AGL.framework" subseq-index? ] unit-test diff --git a/basis/alien/libraries/finder/macosx/macosx.factor b/basis/alien/libraries/finder/macosx/macosx.factor index 9da349bc89..1db7b5481e 100644 --- a/basis/alien/libraries/finder/macosx/macosx.factor +++ b/basis/alien/libraries/finder/macosx/macosx.factor @@ -130,7 +130,7 @@ PRIVATE> : framework-find ( name -- path ) dup dyld-find [ nip ] [ - dup ".framework" subsequence-starts [ + dup ".framework" subseq-index [ dupd head ] [ [ ".framework" append ] keep diff --git a/basis/alien/libraries/finder/windows/windows-tests.factor b/basis/alien/libraries/finder/windows/windows-tests.factor index 6969d528c4..5f2caaf4e5 100644 --- a/basis/alien/libraries/finder/windows/windows-tests.factor +++ b/basis/alien/libraries/finder/windows/windows-tests.factor @@ -1,3 +1,3 @@ USING: alien.libraries.finder sequences tools.test ; -{ t } [ "kernel32" find-library "kernel32.dll" subsequence? ] unit-test +{ t } [ "kernel32" find-library "kernel32.dll" subseq-index? ] unit-test diff --git a/basis/bootstrap/compiler/compiler.factor b/basis/bootstrap/compiler/compiler.factor index feb4a5f1f7..eff2abfbd0 100644 --- a/basis/bootstrap/compiler/compiler.factor +++ b/basis/bootstrap/compiler/compiler.factor @@ -89,7 +89,7 @@ gc "." write flush { - member-eq? split harvest sift cut cut-slice subseq-start subsequence-starts + member-eq? split harvest sift cut cut-slice subseq-start subseq-index index clone set-at reverse push-all class-of number>string string>number like clone-like } compile-unoptimized diff --git a/basis/compression/gzip/gzip.factor b/basis/compression/gzip/gzip.factor index cf8332397b..8c281375ac 100644 --- a/basis/compression/gzip/gzip.factor +++ b/basis/compression/gzip/gzip.factor @@ -16,7 +16,7 @@ SYMBOL: lit-vec :: longest-prefix ( ind seq -- start end ) ind dup ind + seq length min [a..b] seq ind head-slice '[ - [ _ ] dip ind swap seq subsequence-starts + [ _ ] dip ind swap seq subseq-index ] map-find-last ; :: create-pair ( ind seq -- array ) diff --git a/basis/db/sqlite/sqlite.factor b/basis/db/sqlite/sqlite.factor index dc0e0fd590..2aea3e1fb1 100644 --- a/basis/db/sqlite/sqlite.factor +++ b/basis/db/sqlite/sqlite.factor @@ -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+ } subsequence? ; + "sql-spec" get modifiers>> { +on-delete+ +cascade+ } subseq-index? ; : sqlite-trigger, ( string -- ) { } { } 3, ; diff --git a/basis/dns/dns.factor b/basis/dns/dns.factor index 11620c2b02..9f0db9ad2c 100644 --- a/basis/dns/dns.factor +++ b/basis/dns/dns.factor @@ -58,7 +58,7 @@ SYMBOL: dns-servers ERROR: domain-name-contains-empty-label domain ; : check-domain-name ( domain -- domain ) - dup ".." subsequence? [ domain-name-contains-empty-label ] when ; + dup ".." subseq-index? [ domain-name-contains-empty-label ] when ; : >dotted ( domain -- domain' ) dup "." tail? [ "." append ] unless ; diff --git a/basis/fixups/fixups.factor b/basis/fixups/fixups.factor index 77e69dc034..feb0e75a11 100644 --- a/basis/fixups/fixups.factor +++ b/basis/fixups/fixups.factor @@ -48,7 +48,7 @@ CONSTANT: word-renames { { "(all-integers?)" { "all-integers-from?" "0.99" } } { "short" { "bound" "0.99" } } { "map-integers" { "map-integers-as" "0.99" } } - { "deep-subseq?" { "deep-subsequence?" "0.99" } } + { "deep-subseq?" { "deep-subseq-index?" "0.99" } } } : compute-assoc-fixups ( continuation name assoc -- seq ) diff --git a/basis/game/input/iokit/iokit.factor b/basis/game/input/iokit/iokit.factor index 3130e94519..133f0b39b1 100644 --- a/basis/game/input/iokit/iokit.factor +++ b/basis/game/input/iokit/iokit.factor @@ -338,7 +338,7 @@ M: iokit-game-input-backend get-controllers +controller-states+ get-global keys [ controller boa ] map ; : ?glue ( seq subseq sep -- string ) - 2over subsequence-starts [ drop nip ] [ glue ] if ; + 2over subseq-index [ drop nip ] [ glue ] if ; M: iokit-game-input-backend product-string handle>> diff --git a/basis/help/html/html.factor b/basis/help/html/html.factor index caf2c6301f..47ada7afd6 100644 --- a/basis/help/html/html.factor +++ b/basis/help/html/html.factor @@ -140,17 +140,17 @@ M: pathname url-of " white-space: pre-wrap; line-height: 125%;" append ] re-replace-with - dup { "font-family: monospace;" "background-color:" } [ subsequence? ] with all? [ + dup { "font-family: monospace;" "background-color:" } [ subseq-index? ] with all? [ " margin: 10px 0px;" append ] when - dup { "border:" "background-color:" } [ subsequence? ] with all? [ + dup { "border:" "background-color:" } [ subseq-index? ] with all? [ " border-radius: 5px;" append ] when ; : fix-help-header ( classes -- classes ) dup [ - [ ".a" head? ] [ "#f4efd9;" subsequence? ] bi and + [ ".a" head? ] [ "#f4efd9;" subseq-index? ] 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 - dup "{ }" subsequence? [ drop f ] when + dup "{ }" subseq-index? [ 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' ) - dup "@2x" subsequence? [ "." split1-last "@2x." glue ] unless ; + dup "@2x" subseq-index? [ "." split1-last "@2x." glue ] unless ; : ?copy-file ( from to -- ) dup file-exists? [ 2drop ] [ copy-file ] if ; diff --git a/basis/help/lint/checks/checks.factor b/basis/help/lint/checks/checks.factor index 0ccc19b911..8355c22476 100644 --- a/basis/help/lint/checks/checks.factor +++ b/basis/help/lint/checks/checks.factor @@ -152,7 +152,7 @@ SYMBOL: vocab-articles simple-lint-error ] when ] [ - " " subsequence? [ + " " subseq-index? [ "Paragraph text should not contain double spaces" simple-lint-error ] when diff --git a/basis/help/lint/spaces/spaces.factor b/basis/help/lint/spaces/spaces.factor index bdb1c6c2fa..3411fb7ec0 100644 --- a/basis/help/lint/spaces/spaces.factor +++ b/basis/help/lint/spaces/spaces.factor @@ -18,7 +18,7 @@ IN: help.lint.spaces first [ { [ CHAR: space = ] [ CHAR: " = ] } 1|| ] trim-head - " " subsequence? + " " subseq-index? ] filter [ drop ] [ swap . diff --git a/basis/help/search/search.factor b/basis/help/search/search.factor index 00a922558b..90713abae1 100644 --- a/basis/help/search/search.factor +++ b/basis/help/search/search.factor @@ -37,7 +37,7 @@ MEMO: article-words ( name -- words ) search-words [ { } ] [ [ all-articles ] dip dup length 1 > [ - '[ article-words _ subsequence? ] filter + '[ article-words _ subseq-index? ] filter ] [ first '[ article-words [ _ head? ] any? ] filter ] if diff --git a/basis/html/templates/fhtml/fhtml.factor b/basis/html/templates/fhtml/fhtml.factor index 8d64ef8e71..b5b48dc4e3 100644 --- a/basis/html/templates/fhtml/fhtml.factor +++ b/basis/html/templates/fhtml/fhtml.factor @@ -23,7 +23,7 @@ M: template-lexer skip-word DEFER: <% delimiter : check-<% ( lexer -- col ) - [ column>> ] [ line-text>> ] bi "<%" subsequence-starts-from ; + [ column>> ] [ line-text>> ] bi "<%" subseq-index-from ; : found-<% ( accum lexer col -- accum ) [ diff --git a/basis/http/client/client-tests.factor b/basis/http/client/client-tests.factor index cf805380cc..f792d3491a 100644 --- a/basis/http/client/client-tests.factor +++ b/basis/http/client/client-tests.factor @@ -48,8 +48,8 @@ IN: http.client.tests ! hit the velox.ch website. ! { t } [ ! "https://alice.sni.velox.ch" http-get nip - ! [ "Great!" subsequence? ] - ! [ "TLS SNI Test Site: alice.sni.velox.ch" subsequence? ] bi and + ! [ "Great!" subseq-index? ] + ! [ "TLS SNI Test Site: alice.sni.velox.ch" subseq-index? ] bi and ! ] unit-test { t } [ diff --git a/basis/mime/multipart/multipart.factor b/basis/mime/multipart/multipart.factor index 9a6bc0044d..6243112315 100644 --- a/basis/mime/multipart/multipart.factor +++ b/basis/mime/multipart/multipart.factor @@ -42,14 +42,13 @@ C: mime-variable ERROR: mime-decoding-ran-out-of-bytes ; : dump-until-separator ( multipart -- multipart ) - [ ] [ bytes>> ] [ current-separator>> ] tri - over [ mime-decoding-ran-out-of-bytes ] unless - 2dup subsequence-starts [ - swapd cut-slice + [ ] [ current-separator>> ] [ bytes>> ] tri + dup [ mime-decoding-ran-out-of-bytes ] unless + 2dup swap subseq-index [ + cut-slice [ mime-write ] [ swap length tail-slice >>bytes ] bi* ] [ - swap tuck [ length ] bi@ - 1 - cut-slice [ mime-write ] [ >>bytes ] bi* fill-bytes diff --git a/basis/models/search/search.factor b/basis/models/search/search.factor index cb62fa636f..b2ce1efc53 100644 --- a/basis/models/search/search.factor +++ b/basis/models/search/search.factor @@ -7,4 +7,4 @@ IN: models.search '[ _ curry filter ] ; inline : ( values search quot -- model ) - '[ @ [ >case-fold ] bi@ subsequence? ] ; inline + '[ @ [ >case-fold ] bi@ subseq-index? ] ; inline diff --git a/basis/multiline/multiline.factor b/basis/multiline/multiline.factor index a239d10897..cd33adc9be 100644 --- a/basis/multiline/multiline.factor +++ b/basis/multiline/multiline.factor @@ -41,7 +41,7 @@ SYNTAX: STRING: :: (scan-multiline-string) ( i end lexer -- j ) lexer line-text>> :> text lexer still-parsing? [ - i text end subsequence-starts-from [| j | + i text end subseq-index-from [| j | i j text subseq % j end length + ] [ text i bound tail % CHAR: \n , diff --git a/basis/quoted-printable/quoted-printable-tests.factor b/basis/quoted-printable/quoted-printable-tests.factor index 71a800b299..049d2b326b 100644 --- a/basis/quoted-printable/quoted-printable-tests.factor +++ b/basis/quoted-printable/quoted-printable-tests.factor @@ -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" subsequence? ] unit-test +{ f } [ message >quoted "=\r\n" subseq-index? ] unit-test { 1 } [ message >quoted split-lines length ] unit-test -{ t } [ message >quoted-lines "=\r\n" subsequence? ] unit-test +{ t } [ message >quoted-lines "=\r\n" subseq-index? ] unit-test { 4 } [ message >quoted-lines split-lines length ] unit-test { "===o" } [ message >quoted-lines split-lines [ last ] "" map-as ] unit-test diff --git a/basis/sequences/deep/deep-tests.factor b/basis/sequences/deep/deep-tests.factor index 86ace72394..e1b8b6efdf 100644 --- a/basis/sequences/deep/deep-tests.factor +++ b/basis/sequences/deep/deep-tests.factor @@ -34,13 +34,13 @@ IN: sequences.deep.tests [ { { 1 2 3 } 4 } { { { 1 2 3 } 4 } 2 } deep-member? ] unit-test { f } -[ { 1 2 3 { 4 } } { 1 2 3 4 } deep-subsequence? ] unit-test +[ { 1 2 3 { 4 } } { 1 2 3 4 } deep-subseq-index? ] unit-test { t } -[ { 1 2 3 4 } { 1 2 3 4 } deep-subsequence? ] unit-test +[ { 1 2 3 4 } { 1 2 3 4 } deep-subseq-index? ] unit-test { t } -[ { { 1 2 3 4 } } { 1 2 3 4 } deep-subsequence? ] unit-test +[ { { 1 2 3 4 } } { 1 2 3 4 } deep-subseq-index? ] unit-test { 3 } [ { 1 { 2 3 { 4 } } 5 { { 6 } 7 } } 0 [ diff --git a/basis/sequences/deep/deep.factor b/basis/sequences/deep/deep.factor index b376bc116f..a006d08b3d 100644 --- a/basis/sequences/deep/deep.factor +++ b/basis/sequences/deep/deep.factor @@ -54,9 +54,9 @@ M: object branch? drop f ; _ swap dup branch? [ member? ] [ 2drop f ] if ] deep-find >boolean ; -: deep-subsequence? ( seq subseq -- ? ) +: deep-subseq-index? ( seq subseq -- ? ) '[ - _ over branch? [ subsequence? ] [ 2drop f ] if + _ over branch? [ subseq-index? ] [ 2drop f ] if ] deep-find >boolean ; : deep-map! ( ... obj quot: ( ... elt -- ... elt' ) -- ... obj ) diff --git a/basis/tools/test/test-tests.factor b/basis/tools/test/test-tests.factor index c5f815aaf9..4fe22334d7 100644 --- a/basis/tools/test/test-tests.factor +++ b/basis/tools/test/test-tests.factor @@ -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" subsequence? + "OBJ-CURRENT-THREAD" subseq-index? ] unit-test diff --git a/basis/ui/images/images.factor b/basis/ui/images/images.factor index 20a4e6109b..de9c6eee73 100644 --- a/basis/ui/images/images.factor +++ b/basis/ui/images/images.factor @@ -12,7 +12,7 @@ C: image-name >2x? ] bi ; + [ load-image ] [ "@2x" subseq-index? >>2x? ] bi ; PRIVATE> diff --git a/basis/urls/urls.factor b/basis/urls/urls.factor index 30f06abdc8..b9f23f4641 100644 --- a/basis/urls/urls.factor +++ b/basis/urls/urls.factor @@ -164,7 +164,7 @@ PRIVATE> { [ dup "/" head? ] [ nip ] } { [ dup empty? ] [ drop ] } { [ over "/" tail? ] [ append ] } - { [ over "/" subsequence-starts not ] [ nip ] } + { [ over "/" subseq-index not ] [ nip ] } [ [ "/" split1-last drop "/" ] dip 3append ] } cond remove-dot-segments ; diff --git a/core/sequences/sequences-docs.factor b/core/sequences/sequences-docs.factor index 5f9c5f1580..54e7d705b7 100644 --- a/core/sequences/sequences-docs.factor +++ b/core/sequences/sequences-docs.factor @@ -1194,11 +1194,11 @@ HELP: subseq-starts-at? { $values { "i" "a start index" } { "seq" sequence } { "subseq" sequence } { "?" boolean } } { $description "Outputs " { $snippet "t" } " if the subseq starts at the " { $snippet "i" } "th element or outputs " { $link f } " if the sequence is not at that position." } ; -HELP: subsequence-starts +HELP: subseq-index { $values { "seq" sequence } { "subseq" sequence } { "i/f" "a start index or " { $snippet "f" } } } { $description "Outputs the start index of the first contiguous subsequence equal to " { $snippet "subseq" } ", starting the search from the " { $snippet "n" } "th element. If no matching subsequence is found, outputs " { $link f } "." } ; -HELP: subsequence-starts-from +HELP: subseq-index-from { $values { "n" "a start index" } { "seq" sequence } { "subseq" sequence } { "i/f" "a start index or " { $snippet "f" } } } { $description "Outputs the start index of the first contiguous subsequence equal to " { $snippet "subseq" } ", starting the search from the " { $snippet "n" } "th element. If no matching subsequence is found, outputs " { $link f } "." } ; @@ -1947,8 +1947,8 @@ ARTICLE: "sequences-search" "Searching sequences" "Finding the start of a subsequence:" { $subsections subseq-start - subsequence-starts - subsequence-starts-from + subseq-index + subseq-index-from subseq-starts-at? } "Finding the index of an element satisfying a predicate:" diff --git a/core/sequences/sequences.factor b/core/sequences/sequences.factor index 1dbdfa1dc3..213b2f95f0 100644 --- a/core/sequences/sequences.factor +++ b/core/sequences/sequences.factor @@ -1057,17 +1057,20 @@ PRIVATE> [ + _ nth-unsafe ] keep _ nth-unsafe = ] with all-integers? ; inline -: subsequence-starts-from ( n seq subseq -- i/f ) +: subseq-index-from ( n seq subseq -- i/f ) [ [ length ] bi@ - 1 + ] 2keep '[ _ _ subseq-starts-at? ] find-integer-from ; inline -: subsequence-starts ( seq subseq -- i/f ) [ 0 ] 2dip subsequence-starts-from ; inline +: subseq-index ( seq subseq -- i/f ) [ 0 ] 2dip subseq-index-from ; inline -: subsequence? ( seq subseq -- ? ) subsequence-starts >boolean ; inline +: subseq-index? ( seq subseq -- ? ) subseq-index >boolean ; inline -: subseq-start ( subseq seq -- i/f ) swap subsequence-starts ; inline +: subseq-start-from ( subseq seq n -- i/f ) + spin subseq-index-from ; inline deprecated -: subseq? ( subseq seq -- ? ) subseq-start >boolean ; inline +: subseq-start ( subseq seq -- i/f ) swap subseq-index ; inline deprecated + +: subseq? ( subseq seq -- ? ) subseq-start >boolean ; inline deprecated : drop-prefix ( seq1 seq2 -- slice1 slice2 ) 2dup mismatch [ 2dup min-length ] unless* diff --git a/core/splitting/splitting.factor b/core/splitting/splitting.factor index 42a1aaeb92..c658358613 100644 --- a/core/splitting/splitting.factor +++ b/core/splitting/splitting.factor @@ -28,7 +28,7 @@ PRIVATE> > "announce" subsequence? [ + announce-url dup path>> "announce" subseq-index? [ [ "announce" "scrape" replace ] change-path ] [ drop f ] if ; diff --git a/extra/cli/git/git.factor b/extra/cli/git/git.factor index b4d77105b6..67b63b7e30 100644 --- a/extra/cli/git/git.factor +++ b/extra/cli/git/git.factor @@ -63,4 +63,4 @@ cli-git-num-parallel [ cpus 2 * ] initialize : directory-entries-without-git ( directory -- entries ) recursive-directory-entries - [ name>> "/.git/" subsequence? ] reject ; \ No newline at end of file + [ name>> "/.git/" subseq-index? ] reject ; \ No newline at end of file diff --git a/extra/codebase-analyzer/codebase-analyzer.factor b/extra/codebase-analyzer/codebase-analyzer.factor index 84c1ac5541..c0b4226265 100644 --- a/extra/codebase-analyzer/codebase-analyzer.factor +++ b/extra/codebase-analyzer/codebase-analyzer.factor @@ -23,10 +23,10 @@ IN: codebase-analyzer [ has-file-extension? ] filter ; : without-git-paths ( paths -- paths' ) - [ "/.git/" subsequence? ] reject ; + [ "/.git/" subseq-index? ] reject ; : without-node-modules-paths ( paths -- paths' ) - [ "/node_modules/" subsequence? ] reject ; + [ "/node_modules/" subseq-index? ] reject ; : regular-directory-files ( path -- seq ) recursive-directory-files diff --git a/extra/combinators/extras/extras-tests.factor b/extra/combinators/extras/extras-tests.factor index 506dedb315..0f70125a27 100644 --- a/extra/combinators/extras/extras-tests.factor +++ b/extra/combinators/extras/extras-tests.factor @@ -65,23 +65,23 @@ IN: combinators.extras.tests { "hi " "there" } [ "hi there" { - { [ dup "there" subsequence-starts ] [ cut ] } + { [ dup "there" subseq-index ] [ cut ] } [ f ] } cond* ] unit-test { "hi " "there" } [ "hi there" { - { [ dup "foo" subsequence-starts ] [ head f ] } - { [ dup "there" subsequence-starts ] [ cut ] } + { [ dup "foo" subseq-index ] [ head f ] } + { [ dup "there" subseq-index ] [ cut ] } [ f ] } cond* ] unit-test { "hi there" f } [ "hi there" { - { [ dup "foo" subsequence-starts ] [ head f ] } - { [ dup "bar" subsequence-starts ] [ cut ] } + { [ dup "foo" subseq-index ] [ head f ] } + { [ dup "bar" subseq-index ] [ cut ] } [ f ] } cond* ] unit-test diff --git a/extra/gemini/cli/cli.factor b/extra/gemini/cli/cli.factor index 708087c42c..16b2b31109 100644 --- a/extra/gemini/cli/cli.factor +++ b/extra/gemini/cli/cli.factor @@ -101,7 +101,7 @@ CONSTANT: URL V{ } : gemini-go ( args -- ) present [ DEFAULT-URL ] when-empty - { [ dup "://" subsequence? ] [ "gemini://" head? ] } 1|| + { [ dup "://" subseq-index? ] [ "gemini://" head? ] } 1|| [ "gemini://" prepend ] unless dup "gemini://" head? [ [ add-history ] [ add-stack ] [ gemini-get ] tri diff --git a/extra/html/parser/analyzer/analyzer.factor b/extra/html/parser/analyzer/analyzer.factor index 112545e2c7..ceb4086b06 100644 --- a/extra/html/parser/analyzer/analyzer.factor +++ b/extra/html/parser/analyzer/analyzer.factor @@ -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* [ swap subsequence? ] [ 2drop f ] if ; + "href" attribute* [ swap subseq-index? ] [ 2drop f ] if ; : find-hrefs ( vector -- vector' ) [ { [ name>> "a" = ] [ "href" attribute? ] } 1&& ] filter sift diff --git a/extra/io/encodings/detect/detect.factor b/extra/io/encodings/detect/detect.factor index 6c31362da9..3e529166a4 100644 --- a/extra/io/encodings/detect/detect.factor +++ b/extra/io/encodings/detect/detect.factor @@ -17,7 +17,7 @@ default-encoding [ latin1 ] initialize : prolog-encoding ( string -- iana-encoding ) '[ - _ dup "encoding=" subsequence-starts + _ dup "encoding=" subseq-index 10 + swap [ [ 1 - ] dip nth ] [ index-from ] [ swapd subseq ] 2tri ] [ drop "UTF-8" ] recover ; diff --git a/extra/lint/lint.factor b/extra/lint/lint.factor index 034a81ac85..7f925fa9be 100644 --- a/extra/lint/lint.factor +++ b/extra/lint/lint.factor @@ -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 [ subsequence? ] with filter ; + lint-definitions-keys get-global [ subseq-index? ] with filter ; M: word lint ( word -- seq/f ) def>> [ callable? ] deep-filter [ lint ] map concat ; diff --git a/extra/mason/git/git.factor b/extra/mason/git/git.factor index 57cf57bba7..9dcac4048d 100644 --- a/extra/mason/git/git.factor +++ b/extra/mason/git/git.factor @@ -47,7 +47,7 @@ IN: mason.git : git-pull-failed ( error -- ) dup output-process-error? [ - dup output>> "not uptodate. Cannot merge." subsequence? + dup output>> "not uptodate. Cannot merge." subseq-index? [ git-repo-corrupted ] [ rethrow ] if diff --git a/extra/mediawiki/api/api.factor b/extra/mediawiki/api/api.factor index 92c28132a1..8ad8e3d92a 100644 --- a/extra/mediawiki/api/api.factor +++ b/extra/mediawiki/api/api.factor @@ -104,7 +104,7 @@ t botflag set-global : nonce-already-used? ( assoc -- ? ) "error" of [ "code" of "mwoauth-invalid-authorization" = ] - [ "info" of "Nonce already used" subsequence-starts ] bi + [ "info" of "Nonce already used" subseq-index ] bi and ; : readonly? ( assoc -- ? ) diff --git a/extra/metar/metar.factor b/extra/metar/metar.factor index c228fa9b9b..d54c8c2c78 100644 --- a/extra/metar/metar.factor +++ b/extra/metar/metar.factor @@ -282,7 +282,7 @@ CONSTANT: compass-directions H{ ] if ; : parse-weather ( str -- str' ) - dup "VC" subsequence? [ "VC" "" replace t ] [ f ] if + dup "VC" subseq-index? [ "VC" "" replace t ] [ f ] if [ (parse-weather) ] [ [ " in the vicinity" append ] when ] bi* ; diff --git a/extra/modern/slices/slices.factor b/extra/modern/slices/slices.factor index 6740e02d15..ff1a54b511 100644 --- a/extra/modern/slices/slices.factor +++ b/extra/modern/slices/slices.factor @@ -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 ) - n string search subsequence-starts-from :> n' + n string search subseq-index-from :> n' n' [ n string search subseq-expected-but-got-eof ] unless n' search length + string n n' string ? diff --git a/extra/project-euler/047/047.factor b/extra/project-euler/047/047.factor index 601682c3de..e5e94560d6 100644 --- a/extra/project-euler/047/047.factor +++ b/extra/project-euler/047/047.factor @@ -80,7 +80,7 @@ SYMBOL: sieve ] each sieve get ; : consecutive-under ( limit m -- n/f ) - [ prime-tau-upto ] [ dup ] bi* subsequence-starts ; + [ prime-tau-upto ] [ dup ] bi* subseq-index ; PRIVATE> diff --git a/extra/rosetta-code/multisplit/multisplit.factor b/extra/rosetta-code/multisplit/multisplit.factor index 3437741229..1097fa85a0 100644 --- a/extra/rosetta-code/multisplit/multisplit.factor +++ b/extra/rosetta-code/multisplit/multisplit.factor @@ -6,7 +6,7 @@ IN: rosetta-code.multisplit : first-subseq ( seq separators -- n separator ) tuck - [ [ subsequence-starts ] dip 2array ] withd map-index sift-keys + [ [ subseq-index ] dip 2array ] withd map-index sift-keys [ drop f f ] [ [ first ] infimum-by first2 rot nth ] if-empty ; : multisplit ( string separators -- seq ) diff --git a/extra/rosetta-code/text-processing/max-licenses/max-licenses.factor b/extra/rosetta-code/text-processing/max-licenses/max-licenses.factor index dd064e580f..4bf895ccba 100644 --- a/extra/rosetta-code/text-processing/max-licenses/max-licenses.factor +++ b/extra/rosetta-code/text-processing/max-licenses/max-licenses.factor @@ -32,7 +32,7 @@ TUPLE: maxlicense max-count current-count times ; : ( -- max ) -1 0 V{ } clone \ maxlicense boa ; inline -: out? ( line -- ? ) "OUT" subsequence? ; inline +: out? ( line -- ? ) "OUT" subseq-index? ; inline : line-time ( line -- time ) split-words harvest fourth ; inline diff --git a/extra/rosetta-code/web-scraping/web-scraping.factor b/extra/rosetta-code/web-scraping/web-scraping.factor index 0236352327..7a71e19b51 100644 --- a/extra/rosetta-code/web-scraping/web-scraping.factor +++ b/extra/rosetta-code/web-scraping/web-scraping.factor @@ -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" subsequence-starts [ 9 - ] [ 1 - ] bi ] keep subseq print ; + [ "UTC" subseq-index [ 9 - ] [ 1 - ] bi ] keep subseq print ; MAIN: web-scraping-main diff --git a/extra/sequences/extras/extras.factor b/extra/sequences/extras/extras.factor index 3d17c3e755..e26bbb2ad7 100644 --- a/extra/sequences/extras/extras.factor +++ b/extra/sequences/extras/extras.factor @@ -662,7 +662,7 @@ PRIVATE> :: (start-all) ( seq subseq increment -- indices ) 0 - [ seq subseq subsequence-starts-from dup ] + [ seq subseq subseq-index-from dup ] [ [ increment + ] keep ] produce nip ; : start-all ( seq subseq -- indices ) diff --git a/extra/txon/txon.factor b/extra/txon/txon.factor index 2b9110e47e..f384bbb62d 100644 --- a/extra/txon/txon.factor +++ b/extra/txon/txon.factor @@ -42,7 +42,7 @@ DEFER: name/values : name=value ( string -- remain term ) [ unicode:blank? ] trim - dup ":`" subsequence? [ (name=value) ] [ f swap ] if ; + dup ":`" subseq-index? [ (name=value) ] [ f swap ] if ; : name/values ( string -- remain terms ) [ dup { [ empty? not ] [ first CHAR: ` = not ] } 1&& ] diff --git a/extra/zoneinfo/zoneinfo.factor b/extra/zoneinfo/zoneinfo.factor index 3feff6c524..96aed5d375 100644 --- a/extra/zoneinfo/zoneinfo.factor +++ b/extra/zoneinfo/zoneinfo.factor @@ -147,7 +147,7 @@ MEMO: zoneinfo-assoc ( -- assoc ) : zoneinfo-zones ( -- seq ) raw-zone-map keys - [ "/" subsequence? ] partition + [ "/" subseq-index? ] 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 ) { - { [ dup ">=" subsequence? ] [ ">=" split1 swap [ string>number >>day ] dip day-abbrev>= ] } - { [ dup "<=" subsequence? ] [ "<=" split1 swap [ string>number >>day ] dip day-abbrev<= ] } + { [ dup ">=" subseq-index? ] [ ">=" split1 swap [ string>number >>day ] dip day-abbrev>= ] } + { [ dup "<=" subseq-index? ] [ "<=" split1 swap [ string>number >>day ] dip day-abbrev<= ] } [ string>number >>day ] } cond ; -- 2.34.1