From c1cc5fd93170e43e65d6be907dd8ec7314157e12 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Fri, 22 Jul 2022 17:03:24 -0500 Subject: [PATCH] factor: alien.c-types:short -> cramp --- basis/alien/c-types/c-types-docs.factor | 1 - basis/farkup/farkup.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/unix/types/linux/linux.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 +- 34 files changed, 43 insertions(+), 46 deletions(-) diff --git a/basis/alien/c-types/c-types-docs.factor b/basis/alien/c-types/c-types-docs.factor index 4602f7021d..57a24f36e2 100644 --- a/basis/alien/c-types/c-types-docs.factor +++ b/basis/alien/c-types/c-types-docs.factor @@ -131,7 +131,6 @@ $nl ARTICLE: "c-types.ambiguity" "Word name clashes with C types" "Note that some of the C type word names clash with commonly-used Factor words:" { $list - { { $link short } " clashes with the " { $link sequences:short } " word in the " { $vocab-link "sequences" } " vocabulary" } { { $link float } " clashes with the " { $link math:float } " word in the " { $vocab-link "math" } " vocabulary" } } "If you use the wrong vocabulary, you will see a " { $link no-c-type } " error. For example, the following is " { $strong "not" } " valid, and will raise an error because the " { $link math:float } " word from the " { $vocab-link "math" } " vocabulary is not a C type:" diff --git a/basis/farkup/farkup.factor b/basis/farkup/farkup.factor index 57e609836a..6a3192c6d1 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 + short tail-slice ] 2bi ; + [ head ] [ 1 + cramp tail-slice ] 2bi ; : find-cut ( string quot -- before after delimiter ) dupd find diff --git a/basis/formatting/formatting.factor b/basis/formatting/formatting.factor index 04589cfd67..a7fb08ef40 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 '[ _ short head ] ]] +width_ = "." ([0-9])* => [[ second >digits '[ _ cramp head ] ]] width = (width_)? => [[ [ ] or ]] digits_ = "." ([0-9])* => [[ second >digits ]] diff --git a/basis/furnace/syndication/syndication.factor b/basis/furnace/syndication/syndication.factor index 9ef499b2d6..4cfb0cacdb 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 short head-slice [ + 20 cramp head-slice [ >entry clone [ adjust-url ] change-url ] map ; diff --git a/basis/help/apropos/apropos.factor b/basis/help/apropos/apropos.factor index 49e9e2947f..2e4e7de70e 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 short head keys \ $completions prefix , ] + [ max-completions cramp 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 886de9198e..367cb0957f 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 - [ '[ _ short tail ] map! ] unless-zero drop + [ '[ _ cramp 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 8a93f3b73f..2b81292422 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 short head ; + [ sort-values ] dip cramp head ; : analyze-entries ( entries word-names -- errors word-histogram message-histogram ) [ diff --git a/basis/multiline/multiline.factor b/basis/multiline/multiline.factor index bc5e8a4555..00c71b86d0 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 short tail % CHAR: \n , + text i cramp 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 1952edd6e0..95cd1501be 100644 --- a/basis/prettyprint/prettyprint.factor +++ b/basis/prettyprint/prettyprint.factor @@ -70,7 +70,7 @@ SYMBOL: => ] [ ] make ; : remove-breakpoints ( quot pos -- quot' ) - 1 + short cut [ (remove-breakpoints) ] bi@ [ => ] glue ; + 1 + cramp 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 6e3cd4edfa..694061d8ec 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 short head 2 f pad-tail ; + " \t" split harvest 2 cramp 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 abf7dcb953..bd73a11c89 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 short head* "USING:" swap member? ; + chop-; 1 cramp head* "USING:" swap member? ; PRIVATE> diff --git a/basis/tools/trace/trace.factor b/basis/tools/trace/trace.factor index 57f2adb4b4..9888750b37 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* short tail* ] 2bi + [ nip ] [ [ data>> ] [ stack-effect in>> length ] bi* cramp 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 aba3d25f6e..39ce251b5a 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 short cut* ] change-children + [ 100,000 cramp 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 a3d205f378..8a2cf7ce3e 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 short head ] ; + [ ] dip '[ @ >alist 100 cramp head ] ; M: completion-popup focusable-child* table>> ; diff --git a/basis/ui/tools/listener/listener.factor b/basis/ui/tools/listener/listener.factor index f58f53235d..977dc03f00 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 short [ head-slice 0 buf copy ] keep + n cramp [ head-slice 0 buf copy ] keep ] if-zero ; M: interactor stream-read1 diff --git a/basis/unix/types/linux/linux.factor b/basis/unix/types/linux/linux.factor index 49ad297604..a3f0360020 100644 --- a/basis/unix/types/linux/linux.factor +++ b/basis/unix/types/linux/linux.factor @@ -55,7 +55,7 @@ STRUCT: sigset_t { val uchar[128] } ; STRUCT: posix_spawnattr_t - { __flags alien.c-types:short } + { __flags short } { __pgrp pid_t } { __sd sigset_t } { __ss sigset_t } diff --git a/basis/uuid/uuid.factor b/basis/uuid/uuid.factor index 2f2f41dac0..d20e61f265 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 short head be> + md5 checksum-bytes 16 cramp 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 short head be> + sha1 checksum-bytes 16 cramp head be> 5 (version) uuid>string ; : uuid6 ( -- string ) diff --git a/core/sequences/sequences-docs.factor b/core/sequences/sequences-docs.factor index 8c185d586c..63c3921747 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 short head ." + "{ 1 2 } 5 cramp head ." "{ 1 2 }" } } @@ -1096,7 +1096,7 @@ HELP: tail } "When a sequence may not have enough elements:" { $example "USING: sequences prettyprint ;" - "{ 1 2 } 5 short tail ." + "{ 1 2 } 5 cramp tail ." "{ }" } } @@ -1122,7 +1122,7 @@ HELP: head* } "When a sequence may not have enough elements:" { $example "USING: sequences prettyprint ;" - "{ 1 2 } 5 short head* ." + "{ 1 2 } 5 cramp head* ." "{ }" } } @@ -1138,7 +1138,7 @@ HELP: tail* } "When a sequence may not have enough elements:" { $example "USING: sequences prettyprint ;" - "{ 1 2 } 5 short tail* ." + "{ 1 2 } 5 cramp 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: short +HELP: cramp { $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 short [ . ] bi@" + "\"abcd\" 3 cramp [ . ] bi@" "\"abcd\"\n3" } } ; diff --git a/core/sequences/sequences.factor b/core/sequences/sequences.factor index 840fc92795..4b47ef755f 100644 --- a/core/sequences/sequences.factor +++ b/core/sequences/sequences.factor @@ -247,8 +247,6 @@ M: slice virtual@ [ from>> + ] [ seq>> ] bi ; inline M: slice length [ to>> ] [ from>> ] bi - ; inline -: short ( seq n -- seq n' ) over length min ; inline - : cramp ( 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 83f9894512..8fb7d13316 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 short head % ", " % + vm-git-id 10 cramp 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 55e3a2ac1c..87758c875e 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 sequences:short tail* [ normalize-path ] map-keys reverse assoc. nl ] - [ "Top 10 file extension sizes" print sum-sizes-by-extension 10 sequences:short tail* reverse assoc. nl ] - [ "Top 10 text file line counts" print sum-line-counts-by-extension 10 sequences:short tail* reverse assoc. nl ] - [ "Top 10 file extension counts" print count-by-file-extension 10 sequences:short tail* reverse assoc. 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 ] } cleave ; : analyze-codebase ( path -- ) diff --git a/extra/colors/flex-hex/flex-hex.factor b/extra/colors/flex-hex/flex-hex.factor index 356ad4aac9..dce9b420fc 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 short tail* - 2 short head + 8 cramp tail* + 2 cramp head 2 CHAR: 0 pad-head ] map ; diff --git a/extra/hacker-news/hacker-news.factor b/extra/hacker-news/hacker-news.factor index a9ca7c1b05..934c00bffa 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 short head + hacker-news-ids swap cramp 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 4e24860e14..09f10795ab 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 short head + dup 2 cramp head { { 0xff 0xfe } { 0xfe 0xff } } member? utf16 ascii ? decode ; diff --git a/extra/mason/email/email.factor b/extra/mason/email/email.factor index bed5ba472e..99529014b3 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 short head % + current-git-id get 7 cramp head % " -- " % { { status-clean [ "clean" ] } diff --git a/extra/mason/report/report.factor b/extra/mason/report/report.factor index f40a819b02..812478dfec 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 short tail* join-lines ; + [ file-lines ] dip cramp tail* join-lines ; :: failed-report ( error file what -- status ) [ diff --git a/extra/pdf/layout/layout.factor b/extra/pdf/layout/layout.factor index f593f4e7f5..1e76a7a23d 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 short cut + over avail-lines cramp 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 short cut + over avail-lines cramp 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 049a9cad5b..66491aaaff 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 -- ) - [ short head-slice ] dip each ; inline + [ cramp 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 e49b16ff01..c17109188a 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 short tail* reverse slowest-pages set ] + [ slowest cramp 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 8fb54fb3d3..b1f05cf010 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 short head + 1024 cramp 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 519588b51a..08c2fa0bba 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 short head-slice ] when* ; + [ plus-one? [ 1 + ] when cramp 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 728abb1a54..83beb4bbaa 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 short head [ + blogroll fetch-blogroll sort-entries 8 cramp head [ posting new delete-tuples [ insert-tuple ] each ] with-transaction ; diff --git a/extra/youtube/youtube.factor b/extra/youtube/youtube.factor index 5c6e7e9c3a..a043c6c199 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 short head ; + 200 cramp head ; : downloadable? ( video-info -- ? ) "use_cipher_signature" of "False" = ; -- 2.34.1