]> gitweb.factorcode.org Git - factor.git/commitdiff
core: cramp -> bound (was short)
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 23 Jul 2022 17:14:53 +0000 (12:14 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 31 Jul 2022 18:24:58 +0000 (13:24 -0500)
33 files changed:
basis/farkup/farkup.factor
basis/fixups/fixups.factor
basis/formatting/formatting.factor
basis/furnace/syndication/syndication.factor
basis/help/apropos/apropos.factor
basis/help/syntax/syntax.factor
basis/logging/analysis/analysis.factor
basis/multiline/multiline.factor
basis/prettyprint/prettyprint.factor
basis/simple-flat-file/simple-flat-file.factor
basis/tools/completion/completion.factor
basis/tools/trace/trace.factor
basis/ui/gadgets/incremental/incremental.factor
basis/ui/tools/listener/completion/completion.factor
basis/ui/tools/listener/listener.factor
basis/uuid/uuid.factor
core/sequences/sequences-docs.factor
core/sequences/sequences.factor
core/system/system.factor
extra/codebase-analyzer/codebase-analyzer.factor
extra/colors/flex-hex/flex-hex.factor
extra/hacker-news/hacker-news.factor
extra/id3/id3.factor
extra/mason/email/email.factor
extra/mason/report/report.factor
extra/pdf/layout/layout.factor
extra/project-euler/117/117.factor
extra/rosetta-code/top-rank/top-rank.factor
extra/spider/report/report.factor
extra/syslog/syslog.factor
extra/ui/gadgets/charts/lines/lines.factor
extra/webapps/planet/planet.factor
extra/youtube/youtube.factor

index 6a3192c6d1dc4b0fbe2b78bdf708db314bc048df..92b2824fc1aba04b761604439f164c582de1d1e9 100644 (file)
@@ -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
index 096cd4286fcf579e34fcb6ee23abe429877dbba4..e87b0b643446c8df7edcc57beced1b1526f8b475 100644 (file)
@@ -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" } }
 }
 
index a7fb08ef407ced70dc4f2cca36ace256a737cfad..5de21901b3795a93ad581788ac477529f49916e0 100644 (file)
@@ -106,7 +106,7 @@ pad       = pad-align pad-char pad-width => [[ <reversed> >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 ]]
index 4cfb0cacdb8a570cdd6f7affb1663c6622b60286..ad3a1b91274fc93ae1925a5e5e6ce058a54908b8 100644 (file)
@@ -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 ;
index 2e4e7de70e9e6286bde72e2970e16dec07070279..0dd9eb0d57854de92c1010eac78f251bf7a5a677 100644 (file)
@@ -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
index 367cb0957fe7b1dd5d44b2277e97fa59fcc3cfa3..ba658aa3fb692f75e246e7a66234312744d0527a 100644 (file)
@@ -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 )
index 2b812924228f86246a37be25af47c4a89ca03c42..baeeeb0b1664cd5f795e015cf5cfbd112589fb50 100644 (file)
@@ -20,7 +20,7 @@ SYMBOL: message-histogram
     drop ;
 
 : recent-histogram ( assoc n -- alist )
-    [ sort-values <reversed> ] dip cramp head ;
+    [ sort-values <reversed> ] dip bound head ;
 
 : analyze-entries ( entries word-names -- errors word-histogram message-histogram )
     [
index 00c71b86d06bc2f151407008f557b9b41cacc27c..66189cfe7f9fa9e08e7e03065b681934417ba90a 100644 (file)
@@ -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*
index 95cd1501be1476d7d1306664486cc7a03ef708a9..f389b351ecde39e912d0ac93057e197058eec9ea 100644 (file)
@@ -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? ;
 
index 694061d8ec5eda6f3f46b6441b92a76820f87b15..e6c5233f890a9822d98afa30a5df1edc35322143 100644 (file)
@@ -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 [
index bd73a11c89b34792e19e2651a3ccba8b900756a4..49ca364ab54172c1d9e1703799ceb4cb9415ec00 100644 (file)
@@ -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>
 
index 9888750b377973ca5fe8e96fa03fba40958389ac..622cfcb6863abcbe10fe5cc3199a145f1b6dc2c6 100644 (file)
@@ -33,7 +33,7 @@ M: trace-step-state summary
     ] "" make ;
 
 : <trace-step> ( 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 -- )
index 39ce251b5ab59b486fb0cbc077c4b003dc73f54a..578594ad2985e7f693ac9d4581c722633a04a9be 100644 (file)
@@ -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
index 8a2cf7ce3e69447d53a3c57c9f1b0272434896bd..a67a0766959e286984914c321216353f752a495c 100644 (file)
@@ -120,7 +120,7 @@ TUPLE: completion-popup < track interactor table completion-mode ;
     [ completion-popup? ] find-parent ;
 
 : <completion-model> ( editor element quot -- model )
-    [ <element-model> ] dip '[ @ >alist 100 cramp head ] <arrow> ;
+    [ <element-model> ] dip '[ @ >alist 100 bound head ] <arrow> ;
 
 M: completion-popup focusable-child* table>> ;
 
index 977dc03f00b2798ca721678d2ba1ca922cc07412..e366aa543a5772db451d4a80a0bc0bc9b00a8472 100644 (file)
@@ -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
index d20e61f265775310990be5a40dff0ded43f80628..13b055a6c6036ca55cfb46e194127b5c74a6e5c2 100644 (file)
@@ -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 )
index 63c3921747cbba7b248eaa5ff37a0f0c4e49fb7d..1a7f7e74ba7019d98de8f9bbebd2d70938ee7e3a 100644 (file)
@@ -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"
 } } ;
 
index f72ba253ef635edcb88db1266246780863d5da0b..1041d9c9b74564695c7f9d01d70ab5b812e63c43 100644 (file)
@@ -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 <slice> ; inline
 
index 8fb7d13316da0d59192477f3126763ddb01db611..397f7466cad0d4907717bca0bbb01e0fe0628112 100644 (file)
@@ -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 ;
index 87758c875e4c73e70387e2488b8b802776a0b477..3e6082254e3c6e7af96b3dc62225f42b9c439512 100644 (file)
@@ -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 -- )
index dce9b420fc11d287db2aa2769356b0cf3eece9a3..d75f3b2930336ef780862e17630a79607c2abdc4 100644 (file)
@@ -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 ;
 
index 934c00bffa37e5b135fc91d15b25487d05b5ceb7..a4bc74ce04b8b9793eeabbbd2c3ab166a0e08295 100644 (file)
@@ -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 )
index 09f10795abc184a1e1183265b96add071f1e6be9..2e81717d3c6e71b880f19be5e90fda540d9d79dc 100644 (file)
@@ -116,7 +116,7 @@ CONSTANT: id3v1+-length 227
     [ 10 over size>> 10 + ] dip <slice> filter-text-data ;
 
 : decode-text ( string -- string' )
-    dup 2 cramp head
+    dup 2 bound head
     { { 0xff 0xfe } { 0xfe 0xff } } member?
     utf16 ascii ? decode ;
 
index 99529014b33e215fe53018173e538602002a9342..ddeec95bc5add40c944414632e42240d53bec026 100644 (file)
@@ -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" ] }
index 812478dfeccee76d36a9a624ec708b90f3a4eac7..0ec1e4bf48170d52244e7b41ce0b234336b51278 100644 (file)
@@ -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 )
     [
index 1e76a7a23dd93810cba6037be947f4cf8715ffa7..d8b976fcef919c23a987f2cf47ef4421d2afe8bb 100644 (file)
@@ -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 ;
 
index 66491aaaff06db5adb7b91486e3f7bbd2197060d..255fb20bea704934e90fd18536362760632282e9 100644 (file)
@@ -28,7 +28,7 @@ IN: project-euler.117
 <PRIVATE
 
 : next ( seq -- )
-    [ 4 cramp tail* sum ] keep push ;
+    [ 4 bound tail* sum ] keep push ;
 
 : (euler117) ( n -- m )
     [ V{ 1 } clone ] dip over [ next ] curry times last ;
index e9cdba9734ce2f3d4b3e9449650db86a1c5a941c..361aca3b21ffd34446b065e298daad05af5cf84a 100644 (file)
@@ -51,7 +51,7 @@ CONSTANT: employees {
     [ [ salary>> ] 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 [
index c17109188ae75f57235e7306c27b71e5542b0e8c..99c7a720c075b5b570dc08cfc9515f313cf1bd3e 100644 (file)
@@ -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 ]
index b1f05cf01003e538de4182bd81925fb0a615ea90..992b7b9cc8ddf2a454acf1da9e91b3beb6af2334 100644 (file)
@@ -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 <inet4> <datagram> ]
     send ;
index 08c2fa0bba8410a7de9ab071ffaf2328c0e5fb8e..f56c9f93588fe87877c3141bca9e1f6e2c665eac 100644 (file)
@@ -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
index 83beb4bbaa37b8c3d15839075106b4e46433446c..941caecee154f03743c59bd23ae4d4d4bb015318 100644 (file)
@@ -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 ;
index a043c6c199c668b7bf7d8cc9d24b863f2e697909..4d44b7a2fc8844c197fd50bb595a2435def5575c 100644 (file)
@@ -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" = ;