]> gitweb.factorcode.org Git - factor.git/commitdiff
factor: alien.c-types:short -> cramp
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 22 Jul 2022 22:03:24 +0000 (17:03 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 31 Jul 2022 18:24:58 +0000 (13:24 -0500)
34 files changed:
basis/alien/c-types/c-types-docs.factor
basis/farkup/farkup.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/unix/types/linux/linux.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 4602f7021d67b579c935251b18a14a1da99afa5c..57a24f36e228566fbf5e6984e7b2af496d5fc6ec 100644 (file)
@@ -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:"
index 57e609836a2565b381a82c44b42f68b07e7c2c54..6a3192c6d1dc4b0fbe2b78bdf708db314bc048df 100644 (file)
@@ -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
index 04589cfd67fdc381d8ec6ef744752bd83679a172..a7fb08ef407ced70dc4f2cca36ace256a737cfad 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 '[ _ short head ] ]]
+width_    = "." ([0-9])*         => [[ second >digits '[ _ cramp head ] ]]
 width     = (width_)?            => [[ [ ] or ]]
 
 digits_   = "." ([0-9])*         => [[ second >digits ]]
index 9ef499b2d6e2eff51aa1f55dda91f95357827baf..4cfb0cacdb8a570cdd6f7affb1663c6622b60286 100644 (file)
@@ -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 ;
index 49e9e2947f22aa2ce5f6a9b23082bfa60bdfcd09..2e4e7de70e9e6286bde72e2970e16dec07070279 100644 (file)
@@ -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
index 886de9198ece97e0eb8e7a9faa41bbac248d2192..367cb0957fe7b1dd5d44b2277e97fa59fcc3cfa3 100644 (file)
@@ -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 )
index 8a93f3b73f9585b20a18f8d6410cdd08ac76acbe..2b812924228f86246a37be25af47c4a89ca03c42 100644 (file)
@@ -20,7 +20,7 @@ SYMBOL: message-histogram
     drop ;
 
 : recent-histogram ( assoc n -- alist )
-    [ sort-values <reversed> ] dip short head ;
+    [ sort-values <reversed> ] dip cramp head ;
 
 : analyze-entries ( entries word-names -- errors word-histogram message-histogram )
     [
index bc5e8a45553c52b0aca0709f394af7ab991e6447..00c71b86d06bc2f151407008f557b9b41cacc27c 100644 (file)
@@ -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*
index 1952edd6e049911c0d7e01d961659d4a99bb2e35..95cd1501be1476d7d1306664486cc7a03ef708a9 100644 (file)
@@ -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? ;
 
index 6e3cd4edfa5e5f1c0942ccebbd127e4600c77a77..694061d8ec5eda6f3f46b6441b92a76820f87b15 100644 (file)
@@ -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 [
index abf7dcb95347b335f2617fc1ea04dc7e9fc02bd5..bd73a11c89b34792e19e2651a3ccba8b900756a4 100644 (file)
@@ -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>
 
index 57f2adb4b49e41dd7373d59bf862d208b75615a3..9888750b377973ca5fe8e96fa03fba40958389ac 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* short tail* ] 2bi
+    [ nip ] [ [ data>> ] [ stack-effect in>> length ] bi* cramp tail* ] 2bi
     \ trace-step-state boa ;
 
 : print-step ( continuation -- )
index aba3d25f6e7e74770b98d8de2619a0ebaebf69dd..39ce251b5ab59b486fb0cbc077c4b003dc73f54a 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 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
index a3d205f3785a40b9ac73c2ead82503438de312f2..8a2cf7ce3e69447d53a3c57c9f1b0272434896bd 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 short head ] <arrow> ;
+    [ <element-model> ] dip '[ @ >alist 100 cramp head ] <arrow> ;
 
 M: completion-popup focusable-child* table>> ;
 
index f58f53235d4ebddd48e67693c70c02f6533ebc36..977dc03f00b2798ca721678d2ba1ca922cc07412 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 short [ head-slice 0 buf copy ] keep
+        n cramp [ head-slice 0 buf copy ] keep
     ] if-zero ;
 
 M: interactor stream-read1
index 49ad297604a481d9f847cbff6c8531e09365cf35..a3f0360020ded7e958467d08e013487ad5e96f0d 100644 (file)
@@ -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 }
index 2f2f41dac065a236da327a6b23d078fd81488e25..d20e61f265775310990be5a40dff0ded43f80628 100644 (file)
@@ -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 )
index 8c185d586c188c946192bc19c339f8d09fb32f27..63c3921747cbba7b248eaa5ff37a0f0c4e49fb7d 100644 (file)
@@ -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"
 } } ;
 
index 840fc927957b06edd4a4124e22734ca7d5300ce0..4b47ef755f565de0ee92dba950bbb6993f62a374 100644 (file)
@@ -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 <slice> ; inline
index 83f9894512a93cca8afffcf4535d83fbdfdce3c6..8fb7d13316da0d59192477f3126763ddb01db611 100644 (file)
@@ -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 ;
index 55e3a2ac1cb556896a138f99c8b2ad8ce2f2ba06..87758c875e4c73e70387e2488b8b802776a0b477 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 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 -- )
index 356ad4aac92a222ab061509892d16dd20f7794d2..dce9b420fc11d287db2aa2769356b0cf3eece9a3 100644 (file)
@@ -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 ;
 
index a9ca7c1b052bf44705619092e9fa2a6f8629984e..934c00bffa37e5b135fc91d15b25487d05b5ceb7 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 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 )
index 4e24860e141839ee5d90659a29dddb4155cedd4d..09f10795abc184a1e1183265b96add071f1e6be9 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 short head
+    dup 2 cramp head
     { { 0xff 0xfe } { 0xfe 0xff } } member?
     utf16 ascii ? decode ;
 
index bed5ba472e3a6e422e1554905e9ed49d1134f681..99529014b33e215fe53018173e538602002a9342 100644 (file)
@@ -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" ] }
index f40a819b02e2f6bc974894eb2fa91260a69f0b2a..812478dfeccee76d36a9a624ec708b90f3a4eac7 100644 (file)
@@ -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 )
     [
index f593f4e7f5ebea0fb02594ee95059a013255707b..1e76a7a23dd93810cba6037be947f4cf8715ffa7 100644 (file)
@@ -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 ;
 
index 049a9cad5ba47427da615eb522821af701f83bbc..66491aaaff06db5adb7b91486e3f7bbd2197060d 100644 (file)
@@ -28,7 +28,7 @@ IN: project-euler.117
 <PRIVATE
 
 : next ( seq -- )
-    [ 4 short tail* sum ] keep push ;
+    [ 4 cramp tail* sum ] keep push ;
 
 : (euler117) ( n -- m )
     [ V{ 1 } clone ] dip over [ next ] curry times last ;
index 6e32a3909a2aed8b2d2f4ba2befc3c72d6d68050..e9cdba9734ce2f3d4b3e9449650db86a1c5a941c 100644 (file)
@@ -51,7 +51,7 @@ CONSTANT: employees {
     [ [ salary>> ] 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 [
index e49b16ff01d2676fbb462d869a838f3425722e84..c17109188ae75f57235e7306c27b71e5542b0e8c 100644 (file)
@@ -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 ]
index 8fb54fb3d3ebaefc02d3082e9935cfd33da5c9fb..b1f05cf01003e538de4182bd81925fb0a615ea90 100644 (file)
@@ -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 <inet4> <datagram> ]
     send ;
index 519588b51aad887683fd1bc3e7dccc920506045d..08c2fa0bba8410a7de9ab071ffaf2328c0e5fb8e 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 short head-slice ] when* ;
+    [ plus-one? [ 1 + ] when cramp head-slice ] when* ;
 
 ! : data-rect ( data -- rect )
 !    [ [ first x ] [ last x ] bi ] keep
index 728abb1a54ea0ec708d9c6ac60fa0e747ec3b15d..83beb4bbaa37b8c3d15839075106b4e46433446c 100644 (file)
@@ -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 ;
index 5c6e7e9c3a9c89661cf3594c1a61e723ea3c941e..a043c6c199c668b7bf7d8cc9d24b863f2e697909 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 short head ;
+    200 cramp head ;
 
 : downloadable? ( video-info -- ? )
     "use_cipher_signature" of "False" = ;