From: Doug Coleman Date: Fri, 29 Jul 2022 19:27:16 +0000 (-0500) Subject: core: find-subseq -> subsequence-starts, find-subseq-from -> subsequence-starts-from X-Git-Tag: 0.99~1285 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=c8c1211afe2482e9e436c16b57c0decb82686633 core: find-subseq -> subsequence-starts, find-subseq-from -> subsequence-starts-from --- diff --git a/basis/alien/libraries/finder/linux/linux-tests.factor b/basis/alien/libraries/finder/linux/linux-tests.factor index b26947f9c9..a202743fc7 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" find-subseq? ] unit-test -{ t } [ "c" find-library "libc.so" find-subseq? ] unit-test +{ t } [ "m" find-library "libm.so" subsequence? ] unit-test +{ t } [ "c" find-library "libc.so" subsequence? ] unit-test diff --git a/basis/alien/libraries/finder/linux/linux.factor b/basis/alien/libraries/finder/linux/linux.factor index cedd58cb84..d8698ac684 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" find-subseq? ] reject + [ ": Linux" subsequence? ] 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 '[ _ find-subseq? ] find nip + "lib" name append '[ _ subsequence? ] 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 a37425ded4..e79dbb8f6c 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" 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 +{ 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 diff --git a/basis/alien/libraries/finder/macosx/macosx.factor b/basis/alien/libraries/finder/macosx/macosx.factor index d5913c85de..9da349bc89 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" find-subseq [ + dup ".framework" subsequence-starts [ 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 741f4375cb..6969d528c4 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" find-subseq? ] unit-test +{ t } [ "kernel32" find-library "kernel32.dll" subsequence? ] unit-test diff --git a/basis/bootstrap/compiler/compiler.factor b/basis/bootstrap/compiler/compiler.factor index 4d10ced59c..feb4a5f1f7 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 find-subseq + member-eq? split harvest sift cut cut-slice subseq-start subsequence-starts index clone set-at reverse push-all class-of number>string string>number like clone-like } compile-unoptimized diff --git a/basis/db/sqlite/sqlite.factor b/basis/db/sqlite/sqlite.factor index 046e662f5c..dc0e0fd590 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+ } find-subseq? ; + "sql-spec" get modifiers>> { +on-delete+ +cascade+ } subsequence? ; : sqlite-trigger, ( string -- ) { } { } 3, ; diff --git a/basis/dns/dns.factor b/basis/dns/dns.factor index 2cb75d9eb8..11620c2b02 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 ".." find-subseq? [ domain-name-contains-empty-label ] when ; + dup ".." subsequence? [ domain-name-contains-empty-label ] when ; : >dotted ( domain -- domain' ) dup "." tail? [ "." append ] unless ; diff --git a/basis/help/html/html.factor b/basis/help/html/html.factor index fd885b22cf..2aeb70a85a 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 - { "font-family: monospace;" "background-color:" } [ find-subseq? ] with all?[ + { "font-family: monospace;" "background-color:" } [ subsequence? ] with all?[ " margin: 10px 0px;" append ] when - dup { "border:" "background-color:" } [ find-subseq? ] with all? [ + dup { "border:" "background-color:" } [ subsequence? ] with all? [ " border-radius: 5px;" append ] when ; : fix-help-header ( classes -- classes ) dup [ - [ ".a" head? ] [ "#f4efd9;" find-subseq? ] bi and + [ ".a" head? ] [ "#f4efd9;" subsequence? ] 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 "{ }" find-subseq? [ drop f ] when + dup "{ }" subsequence? [ 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" find-subseq? [ "." split1-last "@2x." glue ] unless ; + dup "@2x" subsequence? [ "." 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 fc2b6b9406..0ccc19b911 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 ] [ - " " find-subseq? [ + " " subsequence? [ "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 3419b029d5..bdb1c6c2fa 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 - " " find-subseq? + " " subsequence? ] filter [ drop ] [ swap . diff --git a/basis/help/search/search.factor b/basis/help/search/search.factor index 3910358025..00a922558b 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 _ find-subseq? ] filter + '[ article-words _ subsequence? ] 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 40189add6d..8d64ef8e71 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 "<%" find-subseq-from ; + [ column>> ] [ line-text>> ] bi "<%" subsequence-starts-from ; : found-<% ( accum lexer col -- accum ) [ diff --git a/basis/http/client/client-tests.factor b/basis/http/client/client-tests.factor index aec8f2041f..cf805380cc 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!" find-subseq? ] - ! [ "TLS SNI Test Site: alice.sni.velox.ch" find-subseq? ] bi and + ! [ "Great!" subsequence? ] + ! [ "TLS SNI Test Site: alice.sni.velox.ch" subsequence? ] bi and ! ] unit-test { t } [ diff --git a/basis/models/search/search.factor b/basis/models/search/search.factor index 40f017befd..cb62fa636f 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 ) - '[ swap @ [ >case-fold ] bi@ subseq? ] ; inline + '[ @ [ >case-fold ] bi@ subsequence? ] ; inline diff --git a/basis/multiline/multiline.factor b/basis/multiline/multiline.factor index 66189cfe7f..a239d10897 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 find-subseq-from [| j | + i text end subsequence-starts-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 f57f2f0a1a..71a800b299 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" find-subseq? ] unit-test +{ f } [ message >quoted "=\r\n" subsequence? ] unit-test { 1 } [ message >quoted split-lines length ] unit-test -{ t } [ message >quoted-lines "=\r\n" find-subseq? ] unit-test +{ t } [ message >quoted-lines "=\r\n" subsequence? ] 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.factor b/basis/sequences/deep/deep.factor index 36911bc12b..53910bb776 100644 --- a/basis/sequences/deep/deep.factor +++ b/basis/sequences/deep/deep.factor @@ -56,7 +56,7 @@ M: object branch? drop f ; : deep-subseq? ( subseq seq -- ? ) swap '[ - _ swap dup branch? [ subseq? ] [ 2drop f ] if + _ over branch? [ subsequence? ] [ 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 50e36d4471..c5f815aaf9 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" find-subseq? + "OBJ-CURRENT-THREAD" subsequence? ] unit-test diff --git a/basis/ui/images/images.factor b/basis/ui/images/images.factor index b11520e390..20a4e6109b 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" subsequence? >>2x? ] bi ; PRIVATE> diff --git a/core/sequences/sequences-docs.factor b/core/sequences/sequences-docs.factor index 1a7f7e74ba..5f9c5f1580 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: find-subseq +HELP: subsequence-starts { $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: find-subseq-from +HELP: subsequence-starts-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 - find-subseq - find-subseq-from + subsequence-starts + subsequence-starts-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 cf4514ff90..1dbdfa1dc3 100644 --- a/core/sequences/sequences.factor +++ b/core/sequences/sequences.factor @@ -1057,17 +1057,15 @@ PRIVATE> [ + _ nth-unsafe ] keep _ nth-unsafe = ] with all-integers? ; inline -: find-subseq-from ( n seq subseq -- i/f ) +: subsequence-starts-from ( n seq subseq -- i/f ) [ [ length ] bi@ - 1 + ] 2keep '[ _ _ subseq-starts-at? ] find-integer-from ; inline -: subseq-start-from ( subseq seq n -- i/f ) spin find-subseq-from ; inline +: subsequence-starts ( seq subseq -- i/f ) [ 0 ] 2dip subsequence-starts-from ; inline -: find-subseq ( seq subseq -- i/f ) [ 0 ] 2dip find-subseq-from ; inline +: subsequence? ( seq subseq -- ? ) subsequence-starts >boolean ; inline -: find-subseq? ( seq subseq -- ? ) find-subseq >boolean ; inline - -: subseq-start ( subseq seq -- i/f ) swap find-subseq ; inline +: subseq-start ( subseq seq -- i/f ) swap subsequence-starts ; inline : subseq? ( subseq seq -- ? ) subseq-start >boolean ; inline diff --git a/core/splitting/splitting.factor b/core/splitting/splitting.factor index b72aae53bd..42a1aaeb92 100644 --- a/core/splitting/splitting.factor +++ b/core/splitting/splitting.factor @@ -28,7 +28,7 @@ PRIVATE> > "announce" find-subseq? [ + announce-url dup path>> "announce" subsequence? [ [ "announce" "scrape" replace ] change-path ] [ drop f ] if ; diff --git a/extra/cli/git/git.factor b/extra/cli/git/git.factor index 5a431c3e12..b4d77105b6 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/" find-subseq? ] reject ; \ No newline at end of file + [ name>> "/.git/" subsequence? ] reject ; \ No newline at end of file diff --git a/extra/codebase-analyzer/codebase-analyzer.factor b/extra/codebase-analyzer/codebase-analyzer.factor index 3e6082254e..84c1ac5541 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/" find-subseq? ] reject ; + [ "/.git/" subsequence? ] reject ; : without-node-modules-paths ( paths -- paths' ) - [ "/node_modules/" find-subseq? ] reject ; + [ "/node_modules/" subsequence? ] reject ; : regular-directory-files ( path -- seq ) recursive-directory-files diff --git a/extra/gemini/cli/cli.factor b/extra/gemini/cli/cli.factor index a59cfe68bc..708087c42c 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 "://" find-subseq? ] [ "gemini://" head? ] } 1|| + { [ dup "://" subsequence? ] [ "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 6fd88ddbdc..112545e2c7 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 find-subseq? ] [ 2drop f ] if ; + "href" attribute* [ swap subsequence? ] [ 2drop f ] if ; : find-hrefs ( vector -- vector' ) [ { [ name>> "a" = ] [ "href" attribute? ] } 1&& ] filter sift diff --git a/extra/lint/lint.factor b/extra/lint/lint.factor index 53ef1f453e..034a81ac85 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 [ find-subseq? ] with filter ; + lint-definitions-keys get-global [ subsequence? ] 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 8bc24c406d..57cf57bba7 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." find-subseq? + dup output>> "not uptodate. Cannot merge." subsequence? [ git-repo-corrupted ] [ rethrow ] if diff --git a/extra/mediawiki/api/api.factor b/extra/mediawiki/api/api.factor index 9e6ce829c7..92c28132a1 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" find-subseq ] bi + [ "info" of "Nonce already used" subsequence-starts ] bi and ; : readonly? ( assoc -- ? ) diff --git a/extra/metar/metar.factor b/extra/metar/metar.factor index d882490503..c228fa9b9b 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" find-subseq? [ "VC" "" replace t ] [ f ] if + dup "VC" subsequence? [ "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 001c4e1ad6..6740e02d15 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 find-subseq-from :> n' + n string search subsequence-starts-from :> n' n' [ n string search subseq-expected-but-got-eof ] unless n' search length + string n n' string ? 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 2b875f9726..dd064e580f 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" find-subseq? ; inline +: out? ( line -- ? ) "OUT" subsequence? ; 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 1a426f9a11..0236352327 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" find-subseq [ 9 - ] [ 1 - ] bi ] keep subseq print ; + [ "UTC" subsequence-starts [ 9 - ] [ 1 - ] bi ] keep subseq print ; MAIN: web-scraping-main diff --git a/extra/txon/txon.factor b/extra/txon/txon.factor index f681ef3c21..2b9110e47e 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 ":`" find-subseq? [ (name=value) ] [ f swap ] if ; + dup ":`" subsequence? [ (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 5503f7bf96..3feff6c524 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 - [ "/" find-subseq? ] partition + [ "/" subsequence? ] 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 ">=" find-subseq? ] [ ">=" split1 swap [ string>number >>day ] dip day-abbrev>= ] } - { [ dup "<=" find-subseq? ] [ "<=" split1 swap [ string>number >>day ] dip day-abbrev<= ] } + { [ dup ">=" subsequence? ] [ ">=" split1 swap [ string>number >>day ] dip day-abbrev>= ] } + { [ dup "<=" subsequence? ] [ "<=" split1 swap [ string>number >>day ] dip day-abbrev<= ] } [ string>number >>day ] } cond ;