From 714c6d2b9464e193e24cb45fab1961d96a9d422c Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Wed, 17 Aug 2022 00:19:53 -0500 Subject: [PATCH] core: subseq-index? -> subseq-of? --- basis/alien/libraries/finder/linux/linux-tests.factor | 4 ++-- basis/alien/libraries/finder/linux/linux.factor | 4 ++-- .../alien/libraries/finder/macosx/macosx-tests.factor | 8 ++++---- .../libraries/finder/windows/windows-tests.factor | 2 +- basis/cocoa/application/application.factor | 2 +- basis/db/sqlite/sqlite.factor | 2 +- basis/dns/dns.factor | 2 +- basis/fixups/fixups.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/http/client/client-tests.factor | 4 ++-- basis/quoted-printable/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 +- core/sequences/sequences-docs.factor | 4 ++-- core/sequences/sequences.factor | 2 +- core/strings/strings-tests.factor | 4 ++-- core/system/system-tests.factor | 2 +- extra/bittorrent/bittorrent.factor | 2 +- extra/cli/git/git.factor | 2 +- extra/codebase-analyzer/codebase-analyzer.factor | 4 ++-- extra/gemini/cli/cli.factor | 2 +- extra/gemini/ui/ui.factor | 2 +- extra/gopher/ui/ui.factor | 2 +- extra/html/parser/analyzer/analyzer.factor | 2 +- extra/lint/lint.factor | 2 +- extra/mason/git/git.factor | 2 +- extra/metar/metar.factor | 2 +- .../text-processing/max-licenses/max-licenses.factor | 2 +- extra/txon/txon.factor | 2 +- extra/zoneinfo/zoneinfo.factor | 6 +++--- misc/vim/syntax/factor/generated.vim | 2 +- 36 files changed, 55 insertions(+), 55 deletions(-) diff --git a/basis/alien/libraries/finder/linux/linux-tests.factor b/basis/alien/libraries/finder/linux/linux-tests.factor index aad51a1067..d23a40bc3c 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" subseq-index? ] unit-test -{ t } [ "c" find-library "libc.so" subseq-index? ] unit-test +{ t } [ "m" find-library "libm.so" subseq-of? ] unit-test +{ t } [ "c" find-library "libc.so" subseq-of? ] unit-test diff --git a/basis/alien/libraries/finder/linux/linux.factor b/basis/alien/libraries/finder/linux/linux.factor index 881d3f7e70..58e5050da3 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" subseq-index? ] reject + [ ": Linux" subseq-of? ] 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 '[ _ subseq-index? ] find nip + "lib" name append '[ _ subseq-of? ] 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 c8bd105ccb..aa4244586c 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" 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 +{ t } [ "m" find-library "libm.dylib" subseq-of? ] unit-test +{ t } [ "c" find-library "libc.dylib" subseq-of? ] unit-test +{ t } [ "bz2" find-library "libbz2.dylib" subseq-of? ] unit-test +{ t } [ "AGL" find-library "AGL.framework" subseq-of? ] unit-test diff --git a/basis/alien/libraries/finder/windows/windows-tests.factor b/basis/alien/libraries/finder/windows/windows-tests.factor index 5f2caaf4e5..2d7cdc9677 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" subseq-index? ] unit-test +{ t } [ "kernel32" find-library "kernel32.dll" subseq-of? ] unit-test diff --git a/basis/cocoa/application/application.factor b/basis/cocoa/application/application.factor index 3216427a8c..a738397892 100644 --- a/basis/cocoa/application/application.factor +++ b/basis/cocoa/application/application.factor @@ -41,7 +41,7 @@ FUNCTION: void NSBeep ( ) : running.app? ( -- ? ) ! Test if we're running a .app. NSBundle -> mainBundle -> bundlePath CF>string - ".app" subseq-index? ; + ".app" subseq-of? ; : assert.app ( message -- ) running.app? [ diff --git a/basis/db/sqlite/sqlite.factor b/basis/db/sqlite/sqlite.factor index 2aea3e1fb1..ecc115bd15 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+ } subseq-index? ; + "sql-spec" get modifiers>> { +on-delete+ +cascade+ } subseq-of? ; : sqlite-trigger, ( string -- ) { } { } 3, ; diff --git a/basis/dns/dns.factor b/basis/dns/dns.factor index 9f0db9ad2c..8e7327bff6 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 ".." subseq-index? [ domain-name-contains-empty-label ] when ; + dup ".." subseq-of? [ 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 01472a0326..d2d069497a 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" { "index-or-length" "0.99" } } { "map-integers" { "map-integers-as" "0.99" } } - { "deep-subseq?" { "deep-subseq-index?" "0.99" } } + { "deep-subseq?" { "deep-subseq-of?" "0.99" } } } : compute-assoc-fixups ( continuation name assoc -- seq ) diff --git a/basis/help/html/html.factor b/basis/help/html/html.factor index aba0d61f95..156e97810a 100644 --- a/basis/help/html/html.factor +++ b/basis/help/html/html.factor @@ -150,17 +150,17 @@ M: pathname url-of " white-space: pre-wrap; line-height: 125%;" append ] re-replace-with - dup { "font-family: monospace;" "background-color:" } [ subseq-index? ] with all? [ + dup { "font-family: monospace;" "background-color:" } [ subseq-of? ] with all? [ " margin: 10px 0px;" append ] when - dup { "border:" "background-color:" } [ subseq-index? ] with all? [ + dup { "border:" "background-color:" } [ subseq-of? ] with all? [ " border-radius: 5px;" append ] when ; : fix-help-header ( classes -- classes ) dup [ - [ ".a" head? ] [ "#f4efd9;" subseq-index? ] bi and + [ ".a" head? ] [ "#f4efd9;" subseq-of? ] bi and ] find [ "padding: 10px;" "padding: 0px;" replace "background-color: #f4efd9;" "background-color: white;" replace @@ -198,7 +198,7 @@ M: pathname url-of ] re-replace-with ] map " " join "{ " " }" surround ] re-replace-with " " prepend - dup "{ }" subseq-index? [ drop f ] when + dup "{ }" subseq-of? [ drop f ] when ] map harvest append "}" suffix ; : css-classes ( classes -- stylesheet ) @@ -225,7 +225,7 @@ M: pathname url-of ] each classes sort-values css-classes body ; : retina-image ( path -- path' ) - dup "@2x" subseq-index? [ "." split1-last "@2x." glue ] unless ; + dup "@2x" subseq-of? [ "." 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 ccbd50631f..dfac066116 100644 --- a/basis/help/lint/checks/checks.factor +++ b/basis/help/lint/checks/checks.factor @@ -147,7 +147,7 @@ SYMBOL: vocab-articles simple-lint-error ] when ] [ - " " subseq-index? [ + " " subseq-of? [ "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 3411fb7ec0..d8c6f161ab 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 - " " subseq-index? + " " subseq-of? ] filter [ drop ] [ swap . diff --git a/basis/help/search/search.factor b/basis/help/search/search.factor index 90713abae1..7c4a4b10f4 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 _ subseq-index? ] filter + '[ article-words _ subseq-of? ] filter ] [ first '[ article-words [ _ head? ] any? ] filter ] if diff --git a/basis/http/client/client-tests.factor b/basis/http/client/client-tests.factor index f792d3491a..49b897180e 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!" subseq-index? ] - ! [ "TLS SNI Test Site: alice.sni.velox.ch" subseq-index? ] bi and + ! [ "Great!" subseq-of? ] + ! [ "TLS SNI Test Site: alice.sni.velox.ch" subseq-of? ] bi and ! ] unit-test { t } [ diff --git a/basis/quoted-printable/quoted-printable-tests.factor b/basis/quoted-printable/quoted-printable-tests.factor index 049d2b326b..e8dcf3f33b 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" subseq-index? ] unit-test +{ f } [ message >quoted "=\r\n" subseq-of? ] unit-test { 1 } [ message >quoted split-lines length ] unit-test -{ t } [ message >quoted-lines "=\r\n" subseq-index? ] unit-test +{ t } [ message >quoted-lines "=\r\n" subseq-of? ] 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 e1b8b6efdf..f34428699a 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-subseq-index? ] unit-test +[ { 1 2 3 { 4 } } { 1 2 3 4 } deep-subseq-of? ] unit-test { t } -[ { 1 2 3 4 } { 1 2 3 4 } deep-subseq-index? ] unit-test +[ { 1 2 3 4 } { 1 2 3 4 } deep-subseq-of? ] unit-test { t } -[ { { 1 2 3 4 } } { 1 2 3 4 } deep-subseq-index? ] unit-test +[ { { 1 2 3 4 } } { 1 2 3 4 } deep-subseq-of? ] 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 a006d08b3d..9c1df0d316 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-subseq-index? ( seq subseq -- ? ) +: deep-subseq-of? ( seq subseq -- ? ) '[ - _ over branch? [ subseq-index? ] [ 2drop f ] if + _ over branch? [ subseq-of? ] [ 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 4fe22334d7..71c80992fa 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" subseq-index? + "OBJ-CURRENT-THREAD" subseq-of? ] unit-test diff --git a/basis/ui/images/images.factor b/basis/ui/images/images.factor index de9c6eee73..7247f0c1d9 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-of? >>2x? ] bi ; PRIVATE> diff --git a/core/sequences/sequences-docs.factor b/core/sequences/sequences-docs.factor index fd9cbfacf3..e46441de95 100644 --- a/core/sequences/sequences-docs.factor +++ b/core/sequences/sequences-docs.factor @@ -1245,7 +1245,7 @@ HELP: subseq? { $values { "subseq" sequence } { "seq" sequence } { "?" boolean } } { $description "Tests if " { $snippet "seq" } " contains the elements of " { $snippet "subseq" } " as a contiguous subsequence." } ; -HELP: subseq-index? +HELP: subseq-of? { $values { "seq" sequence } { "subseq" sequence } { "?" boolean } } { $description "Tests if " { $snippet "seq" } " contains the elements of " { $snippet "subseq" } " as a contiguous subsequence." } ; @@ -2027,7 +2027,7 @@ ARTICLE: "sequences-tests" "Testing sequences" "Testing if a sequence contains an object:" { $subsections member? member-eq? } "Testing if a sequence contains a subsequence:" -{ $subsections head? tail? subseq? subseq-index? } ; +{ $subsections head? tail? subseq? subseq-of? } ; ARTICLE: "sequences-search" "Searching sequences" "Finding the index of an element:" diff --git a/core/sequences/sequences.factor b/core/sequences/sequences.factor index 91fc75e518..91e231b190 100644 --- a/core/sequences/sequences.factor +++ b/core/sequences/sequences.factor @@ -1053,7 +1053,7 @@ PRIVATE> : subseq-index ( seq subseq -- i/f ) [ 0 ] 2dip subseq-index-from ; inline -: subseq-index? ( seq subseq -- ? ) subseq-index >boolean ; inline +: subseq-of? ( seq subseq -- ? ) subseq-index >boolean ; inline : subseq-start-from ( subseq seq n -- i/f ) spin subseq-index-from ; inline deprecated diff --git a/core/strings/strings-tests.factor b/core/strings/strings-tests.factor index 8ed0c9c264..0fa54fe49e 100644 --- a/core/strings/strings-tests.factor +++ b/core/strings/strings-tests.factor @@ -35,8 +35,8 @@ vectors ; { f } [ CHAR: I "team" member? ] unit-test { t } [ "ea" "team" subseq? ] unit-test { f } [ "actore" "Factor" subseq? ] unit-test -{ t } [ "team" "ea" subseq-index? ] unit-test -{ f } [ "Factor" "actore" subseq-index? ] unit-test +{ t } [ "team" "ea" subseq-of? ] unit-test +{ f } [ "Factor" "actore" subseq-of? ] unit-test { "end" } [ "Beginning and end" 14 tail ] unit-test diff --git a/core/system/system-tests.factor b/core/system/system-tests.factor index 40d77fdc57..7e7b1076c6 100644 --- a/core/system/system-tests.factor +++ b/core/system/system-tests.factor @@ -3,5 +3,5 @@ USING: arrays kernel sequences system tools.test ; { { t t t } } [ version-info vm-version vm-compiler vm-compile-time 3array - [ subseq-index? ] with map + [ subseq-of? ] with map ] unit-test diff --git a/extra/bittorrent/bittorrent.factor b/extra/bittorrent/bittorrent.factor index b46b00ad80..624544575e 100644 --- a/extra/bittorrent/bittorrent.factor +++ b/extra/bittorrent/bittorrent.factor @@ -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 dup path>> "announce" subseq-index? [ + announce-url dup path>> "announce" subseq-of? [ [ "announce" "scrape" replace ] change-path ] [ drop f ] if ; diff --git a/extra/cli/git/git.factor b/extra/cli/git/git.factor index 39b42f7fd8..0e6063fc0e 100644 --- a/extra/cli/git/git.factor +++ b/extra/cli/git/git.factor @@ -63,5 +63,5 @@ cli-git-num-parallel [ cpus 2 * ] initialize : directory-entries-without-git ( directory -- entries ) recursive-directory-entries - [ name>> "/.git/" subseq-index? ] reject ; + [ name>> "/.git/" subseq-of? ] reject ; diff --git a/extra/codebase-analyzer/codebase-analyzer.factor b/extra/codebase-analyzer/codebase-analyzer.factor index ab5a80a429..25f1315279 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/" subseq-index? ] reject ; + [ "/.git/" subseq-of? ] reject ; : without-node-modules-paths ( paths -- paths' ) - [ "/node_modules/" subseq-index? ] reject ; + [ "/node_modules/" subseq-of? ] reject ; : regular-directory-files ( path -- seq ) recursive-directory-files diff --git a/extra/gemini/cli/cli.factor b/extra/gemini/cli/cli.factor index 16b2b31109..0d815873c9 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 "://" subseq-index? ] [ "gemini://" head? ] } 1|| + { [ dup "://" subseq-of? ] [ "gemini://" head? ] } 1|| [ "gemini://" prepend ] unless dup "gemini://" head? [ [ add-history ] [ add-stack ] [ gemini-get ] tri diff --git a/extra/gemini/ui/ui.factor b/extra/gemini/ui/ui.factor index f40a77abba..a9f3ed1bf9 100644 --- a/extra/gemini/ui/ui.factor +++ b/extra/gemini/ui/ui.factor @@ -29,7 +29,7 @@ M: gemini-gadget model-changed [ url-field>> editor>> set-editor-string ] bi* ; : ?gemini-url ( obj -- url ) - present dup "://" subseq-index? [ "gemini://" prepend ] unless >url ; + present dup "://" subseq-of? [ "gemini://" prepend ] unless >url ; : show-gemini ( url gemini-gadget -- ) [ [ ?gemini-url ] [ f ] if* ] dip diff --git a/extra/gopher/ui/ui.factor b/extra/gopher/ui/ui.factor index edcc48fe6f..be7f9b8d9f 100644 --- a/extra/gopher/ui/ui.factor +++ b/extra/gopher/ui/ui.factor @@ -29,7 +29,7 @@ M: gopher-gadget model-changed [ url-field>> editor>> set-editor-string ] bi* ; : ?gopher-url ( obj -- url ) - present dup "://" subseq-index? [ "gopher://" prepend ] unless >url ; + present dup "://" subseq-of? [ "gopher://" prepend ] unless >url ; : show-gopher ( url gopher-gadget -- ) [ [ ?gopher-url ] [ f ] if* ] dip diff --git a/extra/html/parser/analyzer/analyzer.factor b/extra/html/parser/analyzer/analyzer.factor index ceb4086b06..0964b0ad3f 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 subseq-index? ] [ 2drop f ] if ; + "href" attribute* [ swap subseq-of? ] [ 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 b874bc8abb..84491a5ae4 100644 --- a/extra/lint/lint.factor +++ b/extra/lint/lint.factor @@ -250,7 +250,7 @@ GENERIC: lint ( obj -- seq ) M: object lint ( obj -- seq ) drop f ; M: callable lint ( quot -- seq ) - lint-definitions-keys get-global [ subseq-index? ] with filter ; + lint-definitions-keys get-global [ subseq-of? ] 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 9dcac4048d..9cccf438c7 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." subseq-index? + dup output>> "not uptodate. Cannot merge." subseq-of? [ git-repo-corrupted ] [ rethrow ] if diff --git a/extra/metar/metar.factor b/extra/metar/metar.factor index d54c8c2c78..230081f620 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" subseq-index? [ "VC" "" replace t ] [ f ] if + dup "VC" subseq-of? [ "VC" "" replace t ] [ f ] if [ (parse-weather) ] [ [ " in the vicinity" append ] when ] bi* ; 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 4bf895ccba..9c93117957 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" subseq-index? ; inline +: out? ( line -- ? ) "OUT" subseq-of? ; inline : line-time ( line -- time ) split-words harvest fourth ; inline diff --git a/extra/txon/txon.factor b/extra/txon/txon.factor index f384bbb62d..0e826b2165 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 ":`" subseq-index? [ (name=value) ] [ f swap ] if ; + dup ":`" subseq-of? [ (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 58782b4ed3..1c3f1e329b 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 - [ "/" subseq-index? ] partition + [ "/" subseq-of? ] 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 ">=" subseq-index? ] [ ">=" split1 swap [ string>number >>day ] dip day-abbrev>= ] } - { [ dup "<=" subseq-index? ] [ "<=" split1 swap [ string>number >>day ] dip day-abbrev<= ] } + { [ dup ">=" subseq-of? ] [ ">=" split1 swap [ string>number >>day ] dip day-abbrev>= ] } + { [ dup "<=" subseq-of? ] [ "<=" split1 swap [ string>number >>day ] dip day-abbrev<= ] } [ string>number >>day ] } cond ; diff --git a/misc/vim/syntax/factor/generated.vim b/misc/vim/syntax/factor/generated.vim index 498e9ab3a7..4cc721bd86 100644 --- a/misc/vim/syntax/factor/generated.vim +++ b/misc/vim/syntax/factor/generated.vim @@ -41,7 +41,7 @@ SynKeywordFactorWord factorWord_math | syn keyword factorWord_math contained * + SynKeywordFactorWord factorWord_math_order | syn keyword factorWord_math_order contained +eq+ +gt+ +lt+ <=> >=< [-] after=? after? before=? before? between? clamp compare invert-comparison max min SynKeywordFactorWord factorWord_memory | syn keyword factorWord_memory contained all-instances compact-gc gc instances minor-gc save save-image save-image-and-exit saving-path size SynKeywordFactorWord factorWord_namespaces | syn keyword factorWord_namespaces contained +@ change change-global counter dec get get-global get-namestack global inc init-namestack initialize namespace off on set set-global set-namestack toggle with-global with-scope with-variable with-variables -SynKeywordFactorWord factorWord_sequences | syn keyword factorWord_sequences contained 1sequence 1surround 1surround-as 2all? 2any? 2each 2each-from 2map 2map-as 2map-reduce 2reduce 2selector 2sequence 3append 3append-as 3each 3map 3map-as 3sequence 4sequence >slice< ?first ?last ?nth ?second ?set-nth accumulate accumulate! accumulate* accumulate*! accumulate*-as accumulate-as all? any? append append! append-as assert-sequence assert-sequence= assert-sequence? binary-reduce bounds-check bounds-check? bounds-error bounds-error? but-last but-last-slice cartesian-each cartesian-find cartesian-map cartesian-product cartesian-product-as change-nth check-slice clone-like collapse-slice collector collector-as collector-for collector-for-as concat concat-as copy count cut cut* cut-slice cut-slice* delete-all delete-slice drop-prefix each each-from each-index empty? exchange filter filter! filter-as find find-from find-index find-index-from find-last find-last-from first first2 first3 first4 flip follow fourth from-tail glue glue-as halves harvest head head* head-slice head-slice* head-to-index head? if-empty immutable immutable-sequence immutable-sequence? immutable? index index-from index-of-last index-or-length index-to-tail indices infimum infimum-by insert-nth interleave iota iota? join join-as last last-index last-index-from length lengthen like longer longer? longest map map! map-as map-find map-find-last map-index map-index-as map-integers map-integers-as map-reduce map-sum max-length member-eq? member? midpoint@ min-length mismatch move new-like new-resizable new-sequence non-negative-integer-expected non-negative-integer-expected? none? nth nths pad-head pad-tail partition pop pop* prefix prepend prepend-as produce produce-as product push push-all push-either push-if reduce reduce-index reject reject! reject-as remove remove! remove-eq remove-eq! remove-nth remove-nth! repetition repetition? replace-slice replicate replicate-as rest rest-slice reverse reverse! reversed reversed? second selector selector-as sequence sequence-hashcode sequence= sequence? set-first set-fourth set-last set-length set-nth set-second set-third shorten shorter shorter? shortest sift slice slice-error slice-error? slice? snip snip-slice subseq subseq-as subseq-index subseq-index-from subseq-index? subseq-start subseq-start-from subseq-starts-at? subseq? suffix suffix! sum sum-lengths supremum supremum-by surround surround-as tail tail* tail-slice tail-slice* tail? third trim trim-head trim-head-slice trim-slice trim-tail trim-tail-slice unclip unclip-last unclip-last-slice unclip-slice unless-empty virtual-exemplar virtual-sequence virtual-sequence? virtual@ when-empty +SynKeywordFactorWord factorWord_sequences | syn keyword factorWord_sequences contained 1sequence 1surround 1surround-as 2all? 2any? 2each 2each-from 2map 2map-as 2map-reduce 2reduce 2selector 2sequence 3append 3append-as 3each 3map 3map-as 3sequence 4sequence >slice< ?first ?last ?nth ?second ?set-nth accumulate accumulate! accumulate* accumulate*! accumulate*-as accumulate-as all? any? append append! append-as assert-sequence assert-sequence= assert-sequence? binary-reduce bounds-check bounds-check? bounds-error bounds-error? but-last but-last-slice cartesian-each cartesian-find cartesian-map cartesian-product cartesian-product-as change-nth check-slice clone-like collapse-slice collector collector-as collector-for collector-for-as concat concat-as copy count cut cut* cut-slice cut-slice* delete-all delete-slice drop-prefix each each-from each-index empty? exchange filter filter! filter-as find find-from find-index find-index-from find-last find-last-from first first2 first3 first4 flip follow fourth from-tail glue glue-as halves harvest head head* head-slice head-slice* head-to-index head? if-empty immutable immutable-sequence immutable-sequence? immutable? index index-from index-of-last index-or-length index-to-tail indices infimum infimum-by insert-nth interleave iota iota? join join-as last last-index last-index-from length lengthen like longer longer? longest map map! map-as map-find map-find-last map-index map-index-as map-integers map-integers-as map-reduce map-sum max-length member-eq? member? midpoint@ min-length mismatch move new-like new-resizable new-sequence non-negative-integer-expected non-negative-integer-expected? none? nth nths pad-head pad-tail partition pop pop* prefix prepend prepend-as produce produce-as product push push-all push-either push-if reduce reduce-index reject reject! reject-as remove remove! remove-eq remove-eq! remove-nth remove-nth! repetition repetition? replace-slice replicate replicate-as rest rest-slice reverse reverse! reversed reversed? second selector selector-as sequence sequence-hashcode sequence= sequence? set-first set-fourth set-last set-length set-nth set-second set-third shorten shorter shorter? shortest sift slice slice-error slice-error? slice? snip snip-slice subseq subseq-as subseq-index subseq-index-from subseq-of? subseq-start subseq-start-from subseq-starts-at? subseq? suffix suffix! sum sum-lengths supremum supremum-by surround surround-as tail tail* tail-slice tail-slice* tail? third trim trim-head trim-head-slice trim-slice trim-tail trim-tail-slice unclip unclip-last unclip-last-slice unclip-slice unless-empty virtual-exemplar virtual-sequence virtual-sequence? virtual@ when-empty SynKeywordFactorWord factorWord_sets | syn keyword factorWord_sets contained ?adjoin ?delete adjoin adjoin-all adjoin-at all-unique? cardinality clear-set delete diff diff! duplicates fast-set gather in? intersect intersect! intersect-all intersects? members null? set set-like set= set? subset? union union! union-all within without SynKeywordFactorWord factorWord_sorting | syn keyword factorWord_sorting contained compare-with inv-sort-with natural-sort sort sort-keys sort-pair sort-values sort-with SynKeywordFactorWord factorWord_splitting | syn keyword factorWord_splitting contained ?head ?head-slice ?snip ?snip-slice ?tail ?tail-slice join-lines join-lines-as join-words join-words-as replace split split-indices split-lines split-slice split-subseq split-when split-when-slice split-words split1 split1-last split1-last-slice split1-slice split1-when split1-when-slice string-lines subseq-range -- 2.34.1