From 48138c8cbd6bcaf5a42ceeaa8670857fa50a164a Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 23 Jul 2022 12:14:53 -0500 Subject: [PATCH] core: cramp -> bound (was short) --- basis/farkup/farkup.factor | 2 +- basis/fixups/fixups.factor | 2 +- basis/formatting/formatting.factor | 2 +- basis/furnace/syndication/syndication.factor | 2 +- basis/help/apropos/apropos.factor | 2 +- basis/help/syntax/syntax.factor | 2 +- basis/logging/analysis/analysis.factor | 2 +- basis/multiline/multiline.factor | 2 +- basis/prettyprint/prettyprint.factor | 2 +- basis/simple-flat-file/simple-flat-file.factor | 2 +- basis/tools/completion/completion.factor | 2 +- basis/tools/trace/trace.factor | 2 +- basis/ui/gadgets/incremental/incremental.factor | 2 +- basis/ui/tools/listener/completion/completion.factor | 2 +- basis/ui/tools/listener/listener.factor | 2 +- basis/uuid/uuid.factor | 4 ++-- core/sequences/sequences-docs.factor | 12 ++++++------ core/sequences/sequences.factor | 2 +- core/system/system.factor | 2 +- extra/codebase-analyzer/codebase-analyzer.factor | 8 ++++---- extra/colors/flex-hex/flex-hex.factor | 4 ++-- extra/hacker-news/hacker-news.factor | 2 +- extra/id3/id3.factor | 2 +- extra/mason/email/email.factor | 2 +- extra/mason/report/report.factor | 2 +- extra/pdf/layout/layout.factor | 4 ++-- extra/project-euler/117/117.factor | 2 +- extra/rosetta-code/top-rank/top-rank.factor | 2 +- extra/spider/report/report.factor | 2 +- extra/syslog/syslog.factor | 2 +- extra/ui/gadgets/charts/lines/lines.factor | 2 +- extra/webapps/planet/planet.factor | 2 +- extra/youtube/youtube.factor | 2 +- 33 files changed, 44 insertions(+), 44 deletions(-) diff --git a/basis/farkup/farkup.factor b/basis/farkup/farkup.factor index 6a3192c6d1..92b2824fc1 100644 --- a/basis/farkup/farkup.factor +++ b/basis/farkup/farkup.factor @@ -50,7 +50,7 @@ DEFER: (parse-paragraph) parse-paragraph paragraph boa ; : cut-half-slice ( string i -- before after-slice ) - [ head ] [ 1 + cramp tail-slice ] 2bi ; + [ head ] [ 1 + bound tail-slice ] 2bi ; : find-cut ( string quot -- before after delimiter ) dupd find diff --git a/basis/fixups/fixups.factor b/basis/fixups/fixups.factor index 096cd4286f..e87b0b6434 100644 --- a/basis/fixups/fixups.factor +++ b/basis/fixups/fixups.factor @@ -46,7 +46,7 @@ CONSTANT: word-renames { { "(each-integer)" { "each-integer-from" "0.99" } } { "(find-integer)" { "find-integer-from" "0.99" } } { "(all-integers?)" { "all-integers-from?" "0.99" } } - { "short" { "cramp" "0.99" } } + { "short" { "bound" "0.99" } } { "map-integers" { "map-integers-as" "0.99" } } } diff --git a/basis/formatting/formatting.factor b/basis/formatting/formatting.factor index a7fb08ef40..5de21901b3 100644 --- a/basis/formatting/formatting.factor +++ b/basis/formatting/formatting.factor @@ -106,7 +106,7 @@ pad = pad-align pad-char pad-width => [[ >quotation dup first 0 sign_ = [+ ] => [[ '[ dup first CHAR: - = [ _ prefix ] unless ] ]] sign = (sign_)? => [[ [ ] or ]] -width_ = "." ([0-9])* => [[ second >digits '[ _ cramp head ] ]] +width_ = "." ([0-9])* => [[ second >digits '[ _ bound head ] ]] width = (width_)? => [[ [ ] or ]] digits_ = "." ([0-9])* => [[ second >digits ]] diff --git a/basis/furnace/syndication/syndication.factor b/basis/furnace/syndication/syndication.factor index 4cfb0cacdb..ad3a1b9127 100644 --- a/basis/furnace/syndication/syndication.factor +++ b/basis/furnace/syndication/syndication.factor @@ -29,7 +29,7 @@ M: object >entry } cleave ; : process-entries ( seq -- seq' ) - 20 cramp head-slice [ + 20 bound head-slice [ >entry clone [ adjust-url ] change-url ] map ; diff --git a/basis/help/apropos/apropos.factor b/basis/help/apropos/apropos.factor index 2e4e7de70e..0dd9eb0d57 100644 --- a/basis/help/apropos/apropos.factor +++ b/basis/help/apropos/apropos.factor @@ -52,7 +52,7 @@ M: more-completions article-content completions [ [ { $heading search } , - [ max-completions cramp head keys \ $completions prefix , ] + [ max-completions bound head keys \ $completions prefix , ] [ length max-completions > [ { $link T{ more-completions f completions search category } } , ] when diff --git a/basis/help/syntax/syntax.factor b/basis/help/syntax/syntax.factor index 367cb0957f..ba658aa3fb 100644 --- a/basis/help/syntax/syntax.factor +++ b/basis/help/syntax/syntax.factor @@ -91,7 +91,7 @@ DEFER: HELP{ : trim-whitespace ( seq -- seq' ) dup rest-slice dup whitespace - [ '[ _ cramp tail ] map! ] unless-zero drop + [ '[ _ bound tail ] map! ] unless-zero drop 0 over [ [ blank? ] trim-head ] change-nth ; : code-lines ( str -- seq ) diff --git a/basis/logging/analysis/analysis.factor b/basis/logging/analysis/analysis.factor index 2b81292422..baeeeb0b16 100644 --- a/basis/logging/analysis/analysis.factor +++ b/basis/logging/analysis/analysis.factor @@ -20,7 +20,7 @@ SYMBOL: message-histogram drop ; : recent-histogram ( assoc n -- alist ) - [ sort-values ] dip cramp head ; + [ sort-values ] dip bound head ; : analyze-entries ( entries word-names -- errors word-histogram message-histogram ) [ diff --git a/basis/multiline/multiline.factor b/basis/multiline/multiline.factor index 00c71b86d0..66189cfe7f 100644 --- a/basis/multiline/multiline.factor +++ b/basis/multiline/multiline.factor @@ -44,7 +44,7 @@ SYNTAX: STRING: i text end find-subseq-from [| j | i j text subseq % j end length + ] [ - text i cramp tail % CHAR: \n , + text i bound tail % CHAR: \n , lexer next-line 0 end lexer (scan-multiline-string) ] if* diff --git a/basis/prettyprint/prettyprint.factor b/basis/prettyprint/prettyprint.factor index 95cd1501be..f389b351ec 100644 --- a/basis/prettyprint/prettyprint.factor +++ b/basis/prettyprint/prettyprint.factor @@ -70,7 +70,7 @@ SYMBOL: => ] [ ] make ; : remove-breakpoints ( quot pos -- quot' ) - 1 + cramp cut [ (remove-breakpoints) ] bi@ [ => ] glue ; + 1 + bound cut [ (remove-breakpoints) ] bi@ [ => ] glue ; : optimized-frame? ( triple -- ? ) second word? ; diff --git a/basis/simple-flat-file/simple-flat-file.factor b/basis/simple-flat-file/simple-flat-file.factor index 694061d8ec..e6c5233f89 100644 --- a/basis/simple-flat-file/simple-flat-file.factor +++ b/basis/simple-flat-file/simple-flat-file.factor @@ -12,7 +12,7 @@ IN: simple-flat-file [ drop-comment ] map harvest ; : split-column ( line -- columns ) - " \t" split harvest 2 cramp head 2 f pad-tail ; + " \t" split harvest 2 bound head 2 f pad-tail ; : parse-hex ( s -- n ) dup [ diff --git a/basis/tools/completion/completion.factor b/basis/tools/completion/completion.factor index bd73a11c89..49ca364ab5 100644 --- a/basis/tools/completion/completion.factor +++ b/basis/tools/completion/completion.factor @@ -146,7 +146,7 @@ PRIVATE> { ";" } split1-last [ ] [ ] ?if ; : complete-vocab-list? ( tokens -- ? ) - chop-; 1 cramp head* "USING:" swap member? ; + chop-; 1 bound head* "USING:" swap member? ; PRIVATE> diff --git a/basis/tools/trace/trace.factor b/basis/tools/trace/trace.factor index 9888750b37..622cfcb686 100644 --- a/basis/tools/trace/trace.factor +++ b/basis/tools/trace/trace.factor @@ -33,7 +33,7 @@ M: trace-step-state summary ] "" make ; : ( continuation word -- trace-step ) - [ nip ] [ [ data>> ] [ stack-effect in>> length ] bi* cramp tail* ] 2bi + [ nip ] [ [ data>> ] [ stack-effect in>> length ] bi* bound tail* ] 2bi \ trace-step-state boa ; : print-step ( continuation -- ) diff --git a/basis/ui/gadgets/incremental/incremental.factor b/basis/ui/gadgets/incremental/incremental.factor index 39ce251b5a..578594ad29 100644 --- a/basis/ui/gadgets/incremental/incremental.factor +++ b/basis/ui/gadgets/incremental/incremental.factor @@ -39,7 +39,7 @@ M: incremental dim-changed drop ; dup children>> length 200,000 > [ ! We let the length oscillate between 100k-200k, so we don't ! have to relayout the container every time a gadget is added. - [ 100,000 cramp cut* ] change-children + [ 100,000 bound cut* ] change-children ! Unfocus if any focused gadgets were removed and relayout dup focus>> pick member-eq? [ f >>focus ] when relayout yield diff --git a/basis/ui/tools/listener/completion/completion.factor b/basis/ui/tools/listener/completion/completion.factor index 8a2cf7ce3e..a67a076695 100644 --- a/basis/ui/tools/listener/completion/completion.factor +++ b/basis/ui/tools/listener/completion/completion.factor @@ -120,7 +120,7 @@ TUPLE: completion-popup < track interactor table completion-mode ; [ completion-popup? ] find-parent ; : ( editor element quot -- model ) - [ ] dip '[ @ >alist 100 cramp head ] ; + [ ] dip '[ @ >alist 100 bound head ] ; M: completion-popup focusable-child* table>> ; diff --git a/basis/ui/tools/listener/listener.factor b/basis/ui/tools/listener/listener.factor index 977dc03f00..e366aa543a 100644 --- a/basis/ui/tools/listener/listener.factor +++ b/basis/ui/tools/listener/listener.factor @@ -162,7 +162,7 @@ M:: interactor stream-read-unsafe ( n buf interactor -- count ) n [ 0 ] [ drop interactor interactor-read dup [ join-lines ] when - n cramp [ head-slice 0 buf copy ] keep + n bound [ head-slice 0 buf copy ] keep ] if-zero ; M: interactor stream-read1 diff --git a/basis/uuid/uuid.factor b/basis/uuid/uuid.factor index d20e61f265..13b055a6c6 100644 --- a/basis/uuid/uuid.factor +++ b/basis/uuid/uuid.factor @@ -64,7 +64,7 @@ PRIVATE> : uuid3 ( namespace name -- string ) [ uuid-parse ] dip append - md5 checksum-bytes 16 cramp head be> + md5 checksum-bytes 16 bound head be> 3 (version) uuid>string ; : uuid4 ( -- string ) @@ -73,7 +73,7 @@ PRIVATE> : uuid5 ( namespace name -- string ) [ uuid-parse ] dip append - sha1 checksum-bytes 16 cramp head be> + sha1 checksum-bytes 16 bound head be> 5 (version) uuid>string ; : uuid6 ( -- string ) diff --git a/core/sequences/sequences-docs.factor b/core/sequences/sequences-docs.factor index 63c3921747..1a7f7e74ba 100644 --- a/core/sequences/sequences-docs.factor +++ b/core/sequences/sequences-docs.factor @@ -1080,7 +1080,7 @@ HELP: head } "When a sequence may not have enough elements:" { $example "USING: sequences prettyprint ;" - "{ 1 2 } 5 cramp head ." + "{ 1 2 } 5 bound head ." "{ 1 2 }" } } @@ -1096,7 +1096,7 @@ HELP: tail } "When a sequence may not have enough elements:" { $example "USING: sequences prettyprint ;" - "{ 1 2 } 5 cramp tail ." + "{ 1 2 } 5 bound tail ." "{ }" } } @@ -1122,7 +1122,7 @@ HELP: head* } "When a sequence may not have enough elements:" { $example "USING: sequences prettyprint ;" - "{ 1 2 } 5 cramp head* ." + "{ 1 2 } 5 bound head* ." "{ }" } } @@ -1138,7 +1138,7 @@ HELP: tail* } "When a sequence may not have enough elements:" { $example "USING: sequences prettyprint ;" - "{ 1 2 } 5 cramp tail* ." + "{ 1 2 } 5 bound tail* ." "{ 1 2 }" } } @@ -1627,12 +1627,12 @@ HELP: sequence-hashcode-step { "newhash" integer } } { $description "An implementation word that computes a running hashcode of a sequence using some bit-twiddling. The resulting hashcode is always a fixnum." } ; -HELP: cramp +HELP: bound { $values { "seq" sequence } { "n" integer } { "n'" integer } } { $description "Returns the input sequence and its length or " { $snippet "n" } ", whichever is less." } { $examples { $example "USING: sequences kernel prettyprint ;" - "\"abcd\" 3 cramp [ . ] bi@" + "\"abcd\" 3 bound [ . ] bi@" "\"abcd\"\n3" } } ; diff --git a/core/sequences/sequences.factor b/core/sequences/sequences.factor index f72ba253ef..1041d9c9b7 100644 --- a/core/sequences/sequences.factor +++ b/core/sequences/sequences.factor @@ -247,7 +247,7 @@ M: slice virtual@ [ from>> + ] [ seq>> ] bi ; inline M: slice length [ to>> ] [ from>> ] bi - ; inline -: cramp ( seq n -- seq n' ) over length min ; inline +: bound ( seq n -- seq n' ) over length min ; inline : head-slice ( seq n -- slice ) head-to-index ; inline diff --git a/core/system/system.factor b/core/system/system.factor index 8fb7d13316..397f7466ca 100644 --- a/core/system/system.factor +++ b/core/system/system.factor @@ -77,7 +77,7 @@ PRIVATE> " " % cpu name>> % " (" % build # ", " % vm-git-ref % "-" % - vm-git-id 10 cramp head % ", " % + vm-git-id 10 bound head % ", " % vm-compile-time % ")\n[" % vm-compiler % "] on " % os name>> % ] "" make ; diff --git a/extra/codebase-analyzer/codebase-analyzer.factor b/extra/codebase-analyzer/codebase-analyzer.factor index 87758c875e..3e6082254e 100644 --- a/extra/codebase-analyzer/codebase-analyzer.factor +++ b/extra/codebase-analyzer/codebase-analyzer.factor @@ -167,10 +167,10 @@ IN: codebase-analyzer [ uses-make? [ "uses make" print ] when ] [ rc-files [ length "has %d rc files" sprintf print ] unless-empty ] [ ignore-files [ length "has %d ignore files" sprintf print ] unless-empty nl ] - [ "Top 20 largest files" print file-sizes sort-values 20 cramp tail* [ normalize-path ] map-keys reverse assoc. nl ] - [ "Top 10 file extension sizes" print sum-sizes-by-extension 10 cramp tail* reverse assoc. nl ] - [ "Top 10 text file line counts" print sum-line-counts-by-extension 10 cramp tail* reverse assoc. nl ] - [ "Top 10 file extension counts" print count-by-file-extension 10 cramp tail* reverse assoc. nl ] + [ "Top 20 largest files" print file-sizes sort-values 20 bound tail* [ normalize-path ] map-keys reverse assoc. nl ] + [ "Top 10 file extension sizes" print sum-sizes-by-extension 10 bound tail* reverse assoc. nl ] + [ "Top 10 text file line counts" print sum-line-counts-by-extension 10 bound tail* reverse assoc. nl ] + [ "Top 10 file extension counts" print count-by-file-extension 10 bound tail* reverse assoc. nl ] } cleave ; : analyze-codebase ( path -- ) diff --git a/extra/colors/flex-hex/flex-hex.factor b/extra/colors/flex-hex/flex-hex.factor index dce9b420fc..d75f3b2930 100644 --- a/extra/colors/flex-hex/flex-hex.factor +++ b/extra/colors/flex-hex/flex-hex.factor @@ -19,8 +19,8 @@ IN: colors.flex-hex : hex-rgb ( array -- array' ) [ - 8 cramp tail* - 2 cramp head + 8 bound tail* + 2 bound head 2 CHAR: 0 pad-head ] map ; diff --git a/extra/hacker-news/hacker-news.factor b/extra/hacker-news/hacker-news.factor index 934c00bffa..a4bc74ce04 100644 --- a/extra/hacker-news/hacker-news.factor +++ b/extra/hacker-news/hacker-news.factor @@ -20,7 +20,7 @@ CONSTANT: christmas-green COLOR: #376627 "https://hacker-news.firebaseio.com/v0/item/%d.json?print=pretty" sprintf ; : hacker-news-items ( n endpoint -- seq ) - hacker-news-ids swap cramp head + hacker-news-ids swap bound head [ hacker-news-id>json-url http-get nip json> ] parallel-map ; : hacker-news-top-stories ( n -- seq ) diff --git a/extra/id3/id3.factor b/extra/id3/id3.factor index 09f10795ab..2e81717d3c 100644 --- a/extra/id3/id3.factor +++ b/extra/id3/id3.factor @@ -116,7 +116,7 @@ CONSTANT: id3v1+-length 227 [ 10 over size>> 10 + ] dip filter-text-data ; : decode-text ( string -- string' ) - dup 2 cramp head + dup 2 bound head { { 0xff 0xfe } { 0xfe 0xff } } member? utf16 ascii ? decode ; diff --git a/extra/mason/email/email.factor b/extra/mason/email/email.factor index 99529014b3..ddeec95bc5 100644 --- a/extra/mason/email/email.factor +++ b/extra/mason/email/email.factor @@ -25,7 +25,7 @@ IN: mason.email : report-subject ( status -- string ) [ subject-prefix % - current-git-id get 7 cramp head % + current-git-id get 7 bound head % " -- " % { { status-clean [ "clean" ] } diff --git a/extra/mason/report/report.factor b/extra/mason/report/report.factor index 812478dfec..0ec1e4bf48 100644 --- a/extra/mason/report/report.factor +++ b/extra/mason/report/report.factor @@ -37,7 +37,7 @@ IN: mason.report ] with-file-writer ; inline : file-tail ( file encoding lines -- seq ) - [ file-lines ] dip cramp tail* join-lines ; + [ file-lines ] dip bound tail* join-lines ; :: failed-report ( error file what -- status ) [ diff --git a/extra/pdf/layout/layout.factor b/extra/pdf/layout/layout.factor index 1e76a7a23d..d8b976fcef 100644 --- a/extra/pdf/layout/layout.factor +++ b/extra/pdf/layout/layout.factor @@ -101,7 +101,7 @@ M: p pdf-render [ over ?line-break over [ font>> ] [ avail-width ] bi visual-wrap - over avail-lines cramp cut + over avail-lines bound cut [ draw-text ] [ "" concat-as ] bi* ] change-string dup string>> empty? [ drop f ] when ; @@ -134,7 +134,7 @@ M: text pdf-render [ { } ] [ over [ font>> ] [ width ] bi visual-wrap ] if-empty ] dip [ prefix ] when* - over avail-lines cramp cut + over avail-lines bound cut [ draw-text ] [ "" concat-as ] bi* ] change-string dup string>> empty? [ drop f ] when ; diff --git a/extra/project-euler/117/117.factor b/extra/project-euler/117/117.factor index 66491aaaff..255fb20bea 100644 --- a/extra/project-euler/117/117.factor +++ b/extra/project-euler/117/117.factor @@ -28,7 +28,7 @@ IN: project-euler.117 > ] inv-sort-with ] assoc-map ; : first-n-each ( seq n quot -- ) - [ cramp head-slice ] dip each ; inline + [ bound head-slice ] dip each ; inline : top-rank-main ( -- ) employees prepare-departments [ diff --git a/extra/spider/report/report.factor b/extra/spider/report/report.factor index c17109188a..99c7a720c0 100644 --- a/extra/spider/report/report.factor +++ b/extra/spider/report/report.factor @@ -36,7 +36,7 @@ SYMBOL: time-std : process-timings ( -- ) timings get sort-values - [ slowest cramp tail* reverse slowest-pages set ] + [ slowest bound tail* reverse slowest-pages set ] [ values [ [ mean 1000000 /f mean-time set ] diff --git a/extra/syslog/syslog.factor b/extra/syslog/syslog.factor index b1f05cf010..992b7b9cc8 100644 --- a/extra/syslog/syslog.factor +++ b/extra/syslog/syslog.factor @@ -65,7 +65,7 @@ PRIVATE> : syslog ( message level -- ) utf8 [ write-syslog ] with-byte-writer - 1024 cramp head + 1024 bound head syslog-server get-global $[ f 0 ] send ; diff --git a/extra/ui/gadgets/charts/lines/lines.factor b/extra/ui/gadgets/charts/lines/lines.factor index 08c2fa0bba..f56c9f9358 100644 --- a/extra/ui/gadgets/charts/lines/lines.factor +++ b/extra/ui/gadgets/charts/lines/lines.factor @@ -38,7 +38,7 @@ ALIAS: y second ! right of the index, plus one that's not equal, if requested. :: adjusted-head-slice ( n elt plus-one? seq -- slice ) n seq elt x '[ x _ = not ] find-from drop seq swap - [ plus-one? [ 1 + ] when cramp head-slice ] when* ; + [ plus-one? [ 1 + ] when bound head-slice ] when* ; ! : data-rect ( data -- rect ) ! [ [ first x ] [ last x ] bi ] keep diff --git a/extra/webapps/planet/planet.factor b/extra/webapps/planet/planet.factor index 83beb4bbaa..941caecee1 100644 --- a/extra/webapps/planet/planet.factor +++ b/extra/webapps/planet/planet.factor @@ -93,7 +93,7 @@ posting "POSTINGS" [ date>> ] inv-sort-with ; : update-cached-postings ( -- ) - blogroll fetch-blogroll sort-entries 8 cramp head [ + blogroll fetch-blogroll sort-entries 8 bound head [ posting new delete-tuples [ insert-tuple ] each ] with-transaction ; diff --git a/extra/youtube/youtube.factor b/extra/youtube/youtube.factor index a043c6c199..4d44b7a2fc 100644 --- a/extra/youtube/youtube.factor +++ b/extra/youtube/youtube.factor @@ -61,7 +61,7 @@ CONSTANT: video-info-url URL" http://www.youtube.com/get_video_info" : sanitize ( title -- title' ) [ 0 31 between? ] reject [ "\"#$%'*,./:;<>?^|~\\" member? ] reject - 200 cramp head ; + 200 bound head ; : downloadable? ( video-info -- ? ) "use_cipher_signature" of "False" = ; -- 2.34.1