]> gitweb.factorcode.org Git - factor.git/commitdiff
rename peek -> last and update all usages
authorDoug Coleman <erg@jobim.local>
Mon, 25 May 2009 21:38:33 +0000 (16:38 -0500)
committerDoug Coleman <erg@jobim.local>
Mon, 25 May 2009 21:38:33 +0000 (16:38 -0500)
69 files changed:
basis/bootstrap/compiler/compiler.factor
basis/circular/circular.factor
basis/compiler/cfg/alias-analysis/alias-analysis.factor
basis/compiler/cfg/intrinsics/allot/allot.factor
basis/compiler/cfg/iterator/iterator.factor
basis/compiler/cfg/linear-scan/debugger/debugger.factor
basis/compiler/cfg/linear-scan/linear-scan-tests.factor
basis/compiler/cfg/useless-blocks/useless-blocks.factor
basis/compiler/tree/dead-code/branches/branches.factor
basis/compiler/tree/debugger/debugger.factor
basis/compiler/tree/propagation/constraints/constraints.factor
basis/compiler/tree/propagation/info/info.factor
basis/compiler/tree/tree.factor
basis/csv/csv.factor
basis/documents/documents-tests.factor
basis/documents/documents.factor
basis/farkup/farkup.factor
basis/generalizations/generalizations.factor
basis/heaps/heaps.factor
basis/help/lint/checks/checks.factor
basis/hints/hints.factor
basis/http/parsers/parsers.factor
basis/inspector/inspector.factor
basis/inverse/inverse.factor
basis/lcs/lcs.factor
basis/logging/parser/parser.factor
basis/math/bits/bits-tests.factor
basis/math/polynomials/polynomials.factor
basis/math/ranges/ranges.factor
basis/peg/ebnf/ebnf.factor
basis/persistent/vectors/vectors.factor
basis/porter-stemmer/porter-stemmer.factor
basis/prettyprint/sections/sections.factor
basis/quoted-printable/quoted-printable-tests.factor
basis/quoting/quoting.factor
basis/splitting/monotonic/monotonic.factor
basis/stack-checker/transforms/transforms.factor
basis/tools/completion/completion.factor
basis/ui/backend/cocoa/cocoa.factor
basis/unicode/case/case.factor
basis/unicode/collation/collation.factor
basis/vlists/vlists-tests.factor
basis/xml/xml.factor
core/classes/algebra/algebra.factor
core/continuations/continuations.factor
core/destructors/destructors.factor
core/generic/math/math.factor
core/generic/single/single.factor
core/namespaces/namespaces.factor
core/sequences/sequences-docs.factor
core/sequences/sequences.factor
core/splitting/splitting.factor
core/vectors/vectors-tests.factor
core/vocabs/loader/loader.factor
core/vocabs/parser/parser.factor
extra/24-game/24-game.factor
extra/animations/animations.factor
extra/bson/reader/reader.factor
extra/dns/dns.factor
extra/html/parser/parser.factor
extra/irc/messages/messages.factor
extra/jamshred/tunnel/tunnel.factor
extra/mason/notify/server/server.factor
extra/math/vectors/homogeneous/homogeneous.factor
extra/project-euler/049/049.factor
extra/project-euler/059/059.factor
extra/project-euler/116/116.factor
extra/project-euler/117/117.factor
extra/project-euler/164/164.factor

index 5e3827efea2579a0691ac8312c220e0e41442c52..0505dcb1841fa9610be2d61486c4e21e8bd1fc9f 100755 (executable)
@@ -69,7 +69,7 @@ nl
 "." write flush
 
 {
-    new-sequence nth push pop peek flip
+    new-sequence nth push pop last flip
 } compile-unoptimized
 
 "." write flush
index 909b2ed713727a27fea76b902cbb1f7f5151d5a3..ae79e70d7356a0ef558905e31e284804c9e15218 100644 (file)
@@ -46,13 +46,13 @@ M: growing-circular length length>> ;
 : full? ( circular -- ? )
     [ length ] [ seq>> length ] bi = ;
 
-: set-peek ( elt seq -- )
+: set-last ( elt seq -- )
     [ length 1- ] keep set-nth ;
 PRIVATE>
 
 : push-growing-circular ( elt circular -- )
     dup full? [ push-circular ]
-    [ [ 1+ ] change-length set-peek ] if ;
+    [ [ 1+ ] change-length set-last ] if ;
 
 : <growing-circular> ( capacity -- growing-circular )
     { } new-sequence 0 0 growing-circular boa ;
index ec8fe62dfbf05326078cef474c288f67beb4f639..2a9d2579e33b69531258ea35777720050c6ac9f5 100644 (file)
@@ -165,7 +165,7 @@ SYMBOL: heap-ac
 
 : record-constant-set-slot ( slot# vreg -- )
     history [
-        dup empty? [ dup peek store? [ dup pop* ] when ] unless
+        dup empty? [ dup last store? [ dup pop* ] when ] unless
         store new-action swap ?push
     ] change-at ;
 
index 938dbbccbf9a073e9677da362bffc263fe04499c..7b407c3ee4a9b874f4ee3b04494767703eb4f35d 100644 (file)
@@ -19,7 +19,7 @@ IN: compiler.cfg.intrinsics.allot
     [ second ds-load ] [ ^^load-literal ] bi prefix ;
 
 : emit-<tuple-boa> ( node -- )
-    dup node-input-infos peek literal>>
+    dup node-input-infos last literal>>
     dup array? [
         nip
         ds-drop
index 3444b517ac9083ce9c9aaef459c95654c697e262..a8958733a74f239c2607d09e33060a8b7bd1b034 100644 (file)
@@ -7,7 +7,7 @@ SYMBOL: node-stack
 
 : >node ( cursor -- ) node-stack get push ;
 : node> ( -- cursor ) node-stack get pop ;
-: node@ ( -- cursor ) node-stack get peek ;
+: node@ ( -- cursor ) node-stack get last ;
 : current-node ( -- node ) node@ first ;
 : iterate-next ( -- cursor ) node@ rest-slice ;
 : skip-next ( -- next ) node> rest-slice [ first ] [ >node ] bi ;
index c6481b305edc1de9f809da3463ffd992f80843cb..dad87b62ae39534f865afbc7c6613c82d5caadbb 100644 (file)
@@ -23,7 +23,7 @@ IN: compiler.cfg.linear-scan.debugger
     [ split-children ] map concat check-assigned ;
 
 : picture ( uses -- str )
-    dup peek 1 + CHAR: space <string>
+    dup last 1 + CHAR: space <string>
     [ '[ CHAR: * swap _ set-nth ] each ] keep ;
 
 : interval-picture ( interval -- str )
index 4ddd1fdc0b18256d698ee4f1ae10ba29e25ceb3e..65b932c4a2d492b1754f86b6bf7fda5becc7a5cd 100644 (file)
@@ -244,7 +244,7 @@ SYMBOL: max-uses
                 swap int-regs swap vreg boa >>vreg
                 max-uses get random 2 max [ not-taken ] replicate natural-sort
                 [ >>uses ] [ first >>start ] bi
-                dup uses>> peek >>end
+                dup uses>> last >>end
         ] map
     ] with-scope ;
 
index f543aa4036d816c3216c049ccd00c0a0815a2946..05cb13748b3120cbefb5dec542e1a4314424708b 100644 (file)
@@ -37,7 +37,7 @@ IN: compiler.cfg.useless-blocks
 
 : delete-conditional? ( bb -- ? )
     dup instructions>> [ drop f ] [
-        peek class {
+        last class {
             ##compare-branch
             ##compare-imm-branch
             ##compare-float-branch
index eba82384ab362b2fa8b9171bbbbefb4055458ba2..fd1b2d5adb4cbfe7b1208ae410356a6a69932c1d 100644 (file)
@@ -28,7 +28,7 @@ M: #branch remove-dead-code*
 
 : remove-phi-inputs ( #phi -- )
     if-node get children>>
-    [ dup ends-with-terminate? [ drop f ] [ peek out-d>> ] if ] map
+    [ dup ends-with-terminate? [ drop f ] [ last out-d>> ] if ] map
     pad-with-bottom >>phi-in-d drop ;
 
 : live-value-indices ( values -- indices )
index d1a9f5215ac43c31b791e94a20fe622888ce04c8..4fc4f4814b0c5d84bfdb580a824a8b0cfbba624c 100644 (file)
@@ -191,7 +191,7 @@ SYMBOL: node-count
     propagate
     compute-def-use
     dup check-nodes
-    peek node-input-infos ;
+    last node-input-infos ;
 
 : final-classes ( quot -- seq )
     final-info [ class>> ] map ;
index 2652547aaddb46eb524788216009f82e8f1a5d08..31f6cea14864d9099585aa5b635fcd6f1de3c201 100644 (file)
@@ -83,7 +83,7 @@ TUPLE: implication p q ;
 C: --> implication
 
 : assume-implication ( p q -- )
-    [ constraints get [ assoc-stack swap suffix ] 2keep peek set-at ]
+    [ constraints get [ assoc-stack swap suffix ] 2keep last set-at ]
     [ satisfied? [ assume ] [ drop ] if ] 2bi ;
 
 M: implication assume*
index 4d4b22218ded24298154318b4bf04084589abcad..50762c2b66e643e2c26c12bad966708aaa3eb40a 100644 (file)
@@ -259,12 +259,12 @@ SYMBOL: value-infos
     resolve-copy value-infos get assoc-stack null-info or ;
 
 : set-value-info ( info value -- )
-    resolve-copy value-infos get peek set-at ;
+    resolve-copy value-infos get last set-at ;
 
 : refine-value-info ( info value -- )
     resolve-copy value-infos get
     [ assoc-stack value-info-intersect ] 2keep
-    peek set-at ;
+    last set-at ;
 
 : value-literal ( value -- obj ? )
     value-info >literal< ;
@@ -294,10 +294,10 @@ SYMBOL: value-infos
     dup in-d>> first node-value-info literal>> ;
 
 : last-literal ( #call -- obj )
-    dup out-d>> peek node-value-info literal>> ;
+    dup out-d>> last node-value-info literal>> ;
 
 : immutable-tuple-boa? ( #call -- ? )
     dup word>> \ <tuple-boa> eq? [
-        dup in-d>> peek node-value-info
+        dup in-d>> last node-value-info
         literal>> first immutable-tuple-class?
     ] [ drop f ] if ;
index 9f9a43df6460043c8064149ab4a486b7dffc6172..c73f2211f04b378a33ee1ad5ebddbeaf42bf8f3e 100644 (file)
@@ -169,7 +169,7 @@ M: #return-recursive inputs/outputs [ in-d>> ] [ out-d>> ] bi ;
     [ label>> calls>> [ in-d>> ] map ] [ in-d>> ] bi suffix ;
 
 : ends-with-terminate? ( nodes -- ? )
-    [ f ] [ peek #terminate? ] if-empty ;
+    [ f ] [ last #terminate? ] if-empty ;
 
 M: vector child-visitor V{ } clone ;
 M: vector #introduce, #introduce node, ;
index 5902999a7641f69d8f585dfac75ae992be1d937b..23416d6912aa6899efa3eff7f739fd3d599966d9 100755 (executable)
@@ -63,7 +63,7 @@ PRIVATE>
 
 : csv ( stream -- rows )
     [ [ (csv) ] { } make ] with-input-stream
-    dup peek { "" } = [ but-last ] when ;
+    dup last { "" } = [ but-last ] when ;
 
 : file>csv ( path encoding -- csv )
     <file-reader> csv ;
index b0ff3bc8d8876a6e22501045949f0a2184ab535e..9f7f25c56ea23d7a912ece51dac2b6e85124545e 100644 (file)
@@ -120,7 +120,7 @@ namespaces tools.test make arrays kernel fry ;
 [ "Goodbye, cruel world." ] [ "d" get doc-string ] unit-test
 
 [ "" { 0 9 } { 0 15 } ] [
-    "d" get undos>> peek
+    "d" get undos>> last
     [ old-string>> ] [ from>> ] [ new-to>> ] tri
 ] unit-test
 
@@ -150,4 +150,4 @@ namespaces tools.test make arrays kernel fry ;
 
 [ ] [ "Hello world" "d" get set-doc-string ] unit-test
 
-[ { "" } ] [ "value" get ] unit-test
\ No newline at end of file
+[ { "" } ] [ "value" get ] unit-test
index 104dea6b98a4942076447b421b74e963d8655e26..cc2466053b8718f80b1c382990f863c796186435 100644 (file)
@@ -86,7 +86,7 @@ CONSTANT: doc-start { 0 0 }
         ] [
             first swap length 1- + 0
         ] if
-    ] dip peek length + 2array ;
+    ] dip last length + 2array ;
 
 : prepend-first ( str seq -- )
     0 swap [ append ] change-nth ;
@@ -191,4 +191,4 @@ PRIVATE>
     [ undos>> ] [ redos>> ] [ undo-edit ] undo/redo ;
 
 : redo ( document -- )
-    [ redos>> ] [ undos>> ] [ redo-edit ] undo/redo ;
\ No newline at end of file
+    [ redos>> ] [ undos>> ] [ redo-edit ] undo/redo ;
index a008b1d04937be2d982234c23baef92ca2ac1e25..4acd1eeab81dcc3d2cc373b9d20b7189bbb405a0 100644 (file)
@@ -149,15 +149,15 @@ DEFER: (parse-paragraph)
 
 : trim-row ( seq -- seq' )
     rest
-    dup peek empty? [ but-last ] when ;
+    dup last empty? [ but-last ] when ;
 
-: ?peek ( seq -- elt/f )
-    [ f ] [ peek ] if-empty ;
+: ?last ( seq -- elt/f )
+    [ f ] [ last ] if-empty ;
 
 : coalesce ( rows -- rows' )
     V{ } clone [
         '[
-            _ dup ?peek ?peek CHAR: \\ =
+            _ dup ?last ?last CHAR: \\ =
             [ [ pop "|" rot 3append ] keep ] when
             push 
         ] each
index 397166a4182af0bb28febe6fd5f38577a6fcb4d4..28a1f7dddb487d7c2e3995e91fa0e19d7ced3972 100644 (file)
@@ -76,7 +76,7 @@ MACRO: ncleave ( quots n -- )
 MACRO: nspread ( quots n -- )
     over empty? [ 2drop [ ] ] [
         [ [ but-last ] dip ]
-        [ [ peek ] dip ] 2bi
+        [ [ last ] dip ] 2bi
         swap
         '[ [ _ _ nspread ] _ ndip @ ]
     ] if ;
index 65cb6541f422a4e84880869959242e95355f3c3e..f2ccaad1b4439178339e786950cd5f7654bfa4a8 100644 (file)
@@ -76,7 +76,7 @@ M: heap heap-size ( heap -- n )
     data>> pop* ; inline
 
 : data-peek ( heap -- entry )
-    data>> peek ; inline
+    data>> last ; inline
 
 : data-first ( heap -- entry )
     data>> first ; inline
index 4a15f864a66cc726fdf3806d9cde484399343e9e..f8a4e6c15d900161f1b0fa636a9a09ee5464e468 100644 (file)
@@ -25,7 +25,7 @@ SYMBOL: vocab-articles
             [ (eval>string) ] call( code -- output )
             "\n" ?tail drop
         ] keep
-        peek assert=
+        last assert=
     ] vocabs-quot get call( quot -- ) ;
 
 : check-examples ( element -- )
index 7624cb15175631cd4ec572aa2b10373d1e58f79e..cfd6329b1d4fba2db64818a6bae385fa6c842ded 100644 (file)
@@ -77,7 +77,7 @@ SYNTAX: HINTS:
 { first first2 first3 first4 }
 [ { array } "specializer" set-word-prop ] each
 
-{ peek pop* pop } [
+{ last pop* pop } [
     { vector } "specializer" set-word-prop
 ] each
 
index 1810617c560ddfcddbc26935952143ba613040c3..1a8023681744b17df010579ede78d55187774b18 100644 (file)
@@ -142,7 +142,7 @@ PEG: parse-header-line ( string -- pair )
         'space' ,
         'attr' ,
         'space' ,
-        [ "=" token , 'space' , 'value' , ] seq* [ peek ] action optional ,
+        [ "=" token , 'space' , 'value' , ] seq* [ last ] action optional ,
         'space' ,
     ] seq* ;
 
index 8cab5b5ad362b2dc168c6b527b6ffb04496ab8a1..82c2487f671b30bacb8af47767b6da887e2e7a7e 100644 (file)
@@ -91,7 +91,7 @@ PRIVATE>
 
 : &back ( -- )
     inspector-stack get
-    dup length 1 <= [ drop ] [ [ pop* ] [ peek reinspect ] bi ] if ;
+    dup length 1 <= [ drop ] [ [ pop* ] [ last reinspect ] bi ] if ;
 
 : &add ( value key -- ) mirror get set-at &push reinspect ;
 
index 7690b3441008044b9d0d7ccbe968d33b9174c442..cf97a0b2c8eebf78c0747e18639b6cab8efff03e 100755 (executable)
@@ -220,7 +220,7 @@ DEFER: __
 \ first4 [ 4array ] define-inverse
 
 \ prefix \ unclip define-dual
-\ suffix [ dup but-last swap peek ] define-inverse
+\ suffix [ dup but-last swap last ] define-inverse
 
 \ append 1 [ [ ?tail assure ] curry ] define-pop-inverse
 \ prepend 1 [ [ ?head assure ] curry ] define-pop-inverse
index d32b1998738bf76e7dc17bf03ee59c5d96d1238a..ab4fbd60bb9fdbdf2c7b2daa5ab7768f18b3a950 100644 (file)
@@ -34,7 +34,7 @@ PRIVATE>
 \r
 : levenshtein ( old new -- n )\r
     [ levenshtein-initialize ] [ levenshtein-step ]\r
-    run-lcs peek peek ;\r
+    run-lcs last last ;\r
 \r
 TUPLE: retain item ;\r
 TUPLE: delete item ;\r
index 5406d8fcd0796d1e4a82377e4f3601df5270aa17..dbc26c7efcc31c571ec307f84222a5c67abbb406 100644 (file)
@@ -66,7 +66,7 @@ PEG: parse-log-line ( string -- entry ) 'log-line' ;
     building get empty? [\r
         "Warning: log begins with multiline entry" print drop\r
     ] [\r
-        message>> first building get peek message>> push\r
+        message>> first building get last message>> push\r
     ] if ;\r
 \r
 : parse-log ( lines -- entries )\r
index ed4e8419c965911e3496df60ba19f12b716b9e19..b17d9d8b6e7bf08c024c14dcb0443347db6a4b50 100644 (file)
@@ -23,9 +23,9 @@ IN: math.bits.tests
 ] unit-test
 
 [ t ] [
-    1067811677921310779 make-bits peek
+    1067811677921310779 make-bits last
 ] unit-test
 
 [ t ] [
-    1067811677921310779 >bignum make-bits peek
-] unit-test
\ No newline at end of file
+    1067811677921310779 >bignum make-bits last
+] unit-test
index fd6eda4a905f90fb331149a247c9b69e53763edb..0de18b6febc38320a9acc305edcf16681daa7036 100644 (file)
@@ -48,7 +48,7 @@ PRIVATE>
 
 : /-last ( seq seq -- a )
     #! divide the last two numbers in the sequences
-    [ peek ] bi@ / ;
+    [ last ] bi@ / ;
 
 : (p/mod) ( p p -- p p )
     2dup /-last
index d0c918458a97f9cf03ee08804cbe81b7404ea856..5b4bdae1e606c87fb6c7dd455c296e5e21b2e820 100644 (file)
@@ -56,14 +56,14 @@ PRIVATE>
 : range-decreasing? ( range -- ? )
     step>> 0 < ;
 
-: first-or-peek ( seq head? -- elt )
-    [ first ] [ peek ] if ;
+: first-or-last ( seq head? -- elt )
+    [ first ] [ last ] if ;
 
 : range-min ( range -- min )
-    dup range-increasing? first-or-peek ;
+    dup range-increasing? first-or-last ;
 
 : range-max ( range -- max )
-    dup range-decreasing? first-or-peek ;
+    dup range-decreasing? first-or-last ;
 
 : clamp-to-range ( n range -- n )
     [ range-min ] [ range-max ] bi clamp ;
index f3d555d5a1447bcbef67ce63df5c83398ba593dd..4b2eca69b48dcda99d39d93ba8c0d2d0ccdfe73c 100644 (file)
@@ -370,7 +370,7 @@ SYMBOL: ignore-ws
   ] bind ;\r
 \r
 M: ebnf (transform) ( ast -- parser )\r
-  rules>> [ (transform) ] map peek ;\r
+  rules>> [ (transform) ] map last ;\r
 \r
 M: ebnf-tokenizer (transform) ( ast -- parser )\r
   elements>> dup "default" = [\r
index ae33b7c39aa7f024d06e87ada22923e584a57cf8..5927171aa3b3d13e54301d65bf104e8226f5bd39 100644 (file)
@@ -70,7 +70,7 @@ M: persistent-vector nth-unsafe
     dup level>> 1 = [
         new-child
     ] [
-        tuck children>> peek (ppush-new-tail)
+        tuck children>> last (ppush-new-tail)
         [ swap new-child ] [ swap node-set-last f ] ?if
     ] if ;
 
@@ -127,13 +127,13 @@ M: persistent-vector new-nth ( obj i pvec -- pvec' )
 
 : ppop-contraction ( node -- node' tail' )
     dup children>> length 1 =
-    [ children>> peek f swap ]
+    [ children>> last f swap ]
     [ (ppop-contraction) ]
     if ;
 
 : (ppop-new-tail) ( root -- root' tail' )
     dup level>> 1 > [
-        dup children>> peek (ppop-new-tail) [
+        dup children>> last (ppop-new-tail) [
             dup
             [ swap node-set-last ]
             [ drop ppop-contraction drop ]
index b6eb0ff464d2ce7ec9c6cc68583696bc7bee99db..35ed84aaf48e7aeddf8ddae808dac9e4b40fa7fc 100644 (file)
@@ -52,7 +52,7 @@ USING: kernel math parser sequences combinators splitting ;
 : consonant-end? ( n seq -- ? )
     [ length swap - ] keep consonant? ;
 
-: last-is? ( str possibilities -- ? ) [ peek ] dip member? ;
+: last-is? ( str possibilities -- ? ) [ last ] dip member? ;
 
 : cvc? ( str -- ? )
     {
@@ -67,7 +67,7 @@ USING: kernel math parser sequences combinators splitting ;
     pick consonant-seq 0 > [ nip ] [ drop ] if append ;
 
 : step1a ( str -- newstr )
-    dup peek CHAR: s = [
+    dup last CHAR: s = [
         {
             { [ "sses" ?tail ] [ "ss" append ] }
             { [ "ies" ?tail ] [ "i" append ] }
@@ -199,13 +199,13 @@ USING: kernel math parser sequences combinators splitting ;
     [ 1 = [ but-last-slice cvc? not ] [ drop f ] if ] if ;
 
 : remove-e ( str -- newstr )
-    dup peek CHAR: e = [
+    dup last CHAR: e = [
         dup remove-e? [ but-last-slice ] when
     ] when ;
 
 : ll->l ( str -- newstr )
     {
-        { [ dup peek CHAR: l = not ] [ ] }
+        { [ dup last CHAR: l = not ] [ ] }
         { [ dup length 1- over double-consonant? not ] [ ] }
         { [ dup consonant-seq 1 > ] [ but-last-slice ] }
         [ ]
index b4eb40757d7d974bab75d85a201a38fe70f7564e..0e0c7afb82ad0041c9a4e370f665dfeabed0f2e0 100644 (file)
@@ -153,7 +153,7 @@ TUPLE: block < section sections ;
 : <block> ( style -- block )
     block new-block ;
 
-: pprinter-block ( -- block ) pprinter-stack get peek ;
+: pprinter-block ( -- block ) pprinter-stack get last ;
 
 : add-section ( section -- )
     pprinter-block sections>> push ;
@@ -292,7 +292,7 @@ M: colon unindent-first-line? drop t ;
 
 ! Long section layout algorithm
 : chop-break ( seq -- seq )
-    dup peek line-break? [ but-last-slice chop-break ] when ;
+    dup last line-break? [ but-last-slice chop-break ] when ;
 
 SYMBOL: prev
 SYMBOL: next
@@ -317,7 +317,7 @@ SYMBOL: next
     ] { } make { t } split harvest ;
 
 : break-group? ( seq -- ? )
-    [ first section-fits? ] [ peek section-fits? not ] bi and ;
+    [ first section-fits? ] [ last section-fits? not ] bi and ;
 
 : ?break-group ( seq -- )
     dup break-group? [ first <fresh-line ] [ drop ] if ;
@@ -355,4 +355,4 @@ M: block long-section ( block -- )
     ] with-scope ; inline
 
 : with-pprint ( obj quot -- )
-    make-pprint drop do-pprint ; inline
\ No newline at end of file
+    make-pprint drop do-pprint ; inline
index 6f42a48b37739a6bec1bf92d3c4b27686a8de199..abaff9e222eb804f2e1401e2d0c43a83e6a99d47 100644 (file)
@@ -27,4 +27,4 @@ and we didn't know hów tö do thât"> latin2 encode >quoted ] unit-test
 [ 1 ] [ message >quoted string-lines length ] unit-test
 [ t ] [ message >quoted-lines "=\r\n" swap subseq? ] unit-test
 [ 4 ] [ message >quoted-lines string-lines length ] unit-test
-[ "===o" ] [ message >quoted-lines string-lines [ peek ] "" map-as ] unit-test
+[ "===o" ] [ message >quoted-lines string-lines [ last ] "" map-as ] unit-test
index 5b09347c8c21ca1cc3b7e2f7984104a553d4b7f5..86d8183ac6ecc3573b650486310f8c5a4193b75e 100644 (file)
@@ -9,8 +9,8 @@ IN: quoting
     {
         [ length 1 > ]
         [ first quote? ]
-        [ [ first ] [ peek ] bi = ]
+        [ [ first ] [ last ] bi = ]
     } 1&& ;
 
 : unquote ( str -- newstr )
-    dup quoted? [ but-last-slice rest-slice >string ] when ;
\ No newline at end of file
+    dup quoted? [ but-last-slice rest-slice >string ] when ;
index 2e2ac74e3053673a0ae4f9a2cdd1cbf68208eb52..088de527665d0667adbae979b806174237314f01 100644 (file)
@@ -6,9 +6,9 @@ IN: splitting.monotonic
 
 <PRIVATE
 
-: ,, ( obj -- ) building get peek push ;
+: ,, ( obj -- ) building get last push ;
 : v, ( -- ) V{ } clone , ;
-: ,v ( -- ) building get dup peek empty? [ dup pop* ] when drop ;
+: ,v ( -- ) building get dup last empty? [ dup pop* ] when drop ;
 
 : (monotonic-split) ( seq quot -- newseq )
     [
index a85cd44a47ad42ca313b475754f1a8aa7544da77..017594a4ebb9a108287545758c09b7da0ba0bd6d 100755 (executable)
@@ -57,8 +57,8 @@ IN: stack-checker.transforms
     [
         [ no-case ]
     ] [
-        dup peek callable? [
-            dup peek swap but-last
+        dup last callable? [
+            dup last swap but-last
         ] [
             [ no-case ] swap
         ] if case>quot
index 00d86a1608df9e4811d208c0274614709ed17ed3..c8fd3a6658a2b8547e8c7b0f9d876273e8353b52 100644 (file)
@@ -24,7 +24,7 @@ IN: tools.completion
             2dup number=
             [ drop ] [ nip V{ } clone pick push ] if
             1+
-        ] keep pick peek push
+        ] keep pick last push
     ] each ;
 
 : runs ( seq -- newseq )
@@ -78,4 +78,4 @@ IN: tools.completion
     all-vocabs-seq name-completions ;
 
 : chars-matching ( str -- seq )
-    name-map keys dup zip completions ;
\ No newline at end of file
+    name-map keys dup zip completions ;
index b6c9b4327120ec7b50aa1f13e1db823fcafe3426..aa84ee43c5350ff1c7e1f65bda88d9c77aba61aa 100755 (executable)
@@ -83,7 +83,7 @@ M: pasteboard set-clipboard-contents
     dup { 0 0 } = [
         drop
         windows get length 1 <= [ -> center ] [
-            windows get peek second window-loc>>
+            windows get last second window-loc>>
             dupd first2 <CGPoint> -> cascadeTopLeftFromPoint:
             -> setFrameTopLeftPoint:
         ] if
index 1ad39317469939c54b144961b84f3df21598c440..79db087220e6ced846787b88826c0dea72e7d5ad 100644 (file)
@@ -59,7 +59,7 @@ SYMBOL: locale ! Just casing locale, or overall?
 
 : fix-sigma-end ( string -- string )
     [ "" ] [
-        dup peek CHAR: greek-small-letter-sigma =
+        dup last CHAR: greek-small-letter-sigma =
         [ 1 head* CHAR: greek-small-letter-final-sigma suffix ] when
     ] if-empty ; inline
 
index f8beca3c600cd6334522c499c570e1875b80d465..5cab884b3c4c7eb6bba2702a971fd048c7d943e0 100755 (executable)
@@ -63,13 +63,13 @@ ducet insert-helpers
     [ drop { } ]\r
     [ [ AAAA ] [ BBBB ] bi 2array ] if ;\r
 \r
-: last ( -- char )\r
-    building get empty? [ 0 ] [ building get peek peek ] if ;\r
+: building-last ( -- char )\r
+    building get empty? [ 0 ] [ building get last last ] if ;\r
 \r
 : blocked? ( char -- ? )\r
     combining-class dup { 0 f } member?\r
-    [ drop last non-starter? ]\r
-    [ last combining-class = ] if ;\r
+    [ drop building-last non-starter? ]\r
+    [ building-last combining-class = ] if ;\r
 \r
 : possible-bases ( -- slice-of-building )\r
     building get dup [ first non-starter? not ] find-last\r
index 3546051364ec5b4450dd8208ce5ef82924b168bf..6df942eb84ed219994bfc2bdaf301814f34ac099 100644 (file)
@@ -16,7 +16,7 @@ IN: vlists.tests
 [ "foo" VL{ "hi" "there" } t ]
 [
     VL{ "hi" "there" "foo" } dup "v" set
-    [ peek ] [ ppop ] bi
+    [ last ] [ ppop ] bi
     dup "v" get [ vector>> ] bi@ eq?
 ] unit-test
 
index 9df7165e6cd7da88f48ef0555e9bda6a84c3654a..cca1b5e2e0cf4160f8538a39e59b73b983e4ceab 100755 (executable)
@@ -11,7 +11,7 @@ IN: xml
 <PRIVATE
 
 : add-child ( object -- )
-    xml-stack get peek second push ;
+    xml-stack get last second push ;
 
 : push-xml ( object -- )
     V{ } clone 2array xml-stack get push ;
index c774ef1c1dce1fe4d0eb8e6cb3aded20e55d75d8..3c39848d0247a10e1fbb61da3a660310a10548ff 100755 (executable)
@@ -215,7 +215,7 @@ M: anonymous-complement (classes-intersect?)
 : min-class ( class seq -- class/f )\r
     over [ classes-intersect? ] curry filter\r
     [ drop f ] [\r
-        [ nip ] [ [ class<= ] with all? ] 2bi [ peek ] [ drop f ] if\r
+        [ nip ] [ [ class<= ] with all? ] 2bi [ last ] [ drop f ] if\r
     ] if-empty ;\r
 \r
 GENERIC: (flatten-class) ( class -- )\r
index 7681c2b089f5543acf06398de31932ba82384906..8e14f4a26ba770b83def7f6b3fcbabc778a88bd1 100644 (file)
@@ -152,7 +152,7 @@ ERROR: attempt-all-error ;
     ] [
         [
             [ [ , f ] compose [ , drop t ] recover ] curry all?
-        ] { } make peek swap [ rethrow ] when
+        ] { } make last swap [ rethrow ] when
     ] if ; inline
 
 TUPLE: condition error restarts continuation ;
index afc956fae473592ab7635f80b3ee5c3cb6cb6510..9a470d53c141f93d3761753965afb7452cee922b 100644 (file)
@@ -21,7 +21,7 @@ M: object dispose
 : dispose-each ( seq -- )
     [
         [ [ dispose ] curry [ , ] recover ] each
-    ] { } make [ peek rethrow ] unless-empty ;
+    ] { } make [ last rethrow ] unless-empty ;
 
 : with-disposal ( object quot -- )
     over [ dispose ] curry [ ] cleanup ; inline
index c96050ad03dc38af22f083130127ea37b5ffb377..e88c0c02e4f694cee8e174e7234a26f29b75b5a5 100644 (file)
@@ -15,7 +15,7 @@ PREDICATE: math-class < class
 
 <PRIVATE
 
-: last/first ( seq -- pair ) [ peek ] [ first ] bi 2array ;
+: last/first ( seq -- pair ) [ last ] [ first ] bi 2array ;
 
 : bootstrap-words ( classes -- classes' )
     [ bootstrap-word ] map ;
index 8a2243c2643060a8d2c03e569857f84532c3e30f..9a773f43a2b5c0f78fe38afb6896243cbd0ec365 100644 (file)
@@ -235,7 +235,7 @@ M: predicate-engine-word stack-effect "owner-generic" word-prop stack-effect ;
     quote-methods
     prune-redundant-predicates
     class-predicates
-    [ peek ] [ alist>quot picker prepend define-predicate-engine ] if-empty ;
+    [ last ] [ alist>quot picker prepend define-predicate-engine ] if-empty ;
 
 M: predicate-engine compile-engine
     [ compile-predicate-engine ] [ class>> ] bi
index 64cc328d19ea90075fa5aa677b39a8edfb4132a4..9428445d267adb1d83321d1d4c01b143085012f5 100644 (file)
@@ -12,7 +12,7 @@ IN: namespaces
 
 PRIVATE>
 
-: namespace ( -- namespace ) namestack* peek ; inline
+: namespace ( -- namespace ) namestack* last ; inline
 : namestack ( -- namestack ) namestack* clone ;
 : set-namestack ( namestack -- ) >vector 0 setenv ;
 : global ( -- g ) 21 getenv { hashtable } declare ; inline
index b6cfface122944b6c53562f877ad3dbe06ccdc25..04c9aca03576f1aa80bf172268ac5c630d691161 100755 (executable)
@@ -546,12 +546,12 @@ HELP: join
 
 { join concat concat-as } related-words
 
-HELP: peek
+HELP: last
 { $values { "seq" sequence } { "elt" object } }
 { $description "Outputs the last element of a sequence." }
 { $errors "Throws an error if the sequence is empty." } ;
 
-{ peek pop pop* } related-words
+{ last pop pop* } related-words
 
 HELP: pop*
 { $values { "seq" "a resizable mutable sequence" } }
@@ -1382,7 +1382,7 @@ ARTICLE: "sequences-access" "Accessing sequence elements"
 { $subsection first2 }
 { $subsection first3 }
 { $subsection first4 }
-{ $see-also nth peek } ;
+{ $see-also nth last } ;
 
 ARTICLE: "sequences-add-remove" "Adding and removing sequence elements"
 "Adding elements:"
@@ -1579,7 +1579,6 @@ ARTICLE: "sequences-destructive" "Destructive operations"
 
 ARTICLE: "sequences-stacks" "Treating sequences as stacks"
 "The classical stack operations, modifying a sequence in place:"
-{ $subsection peek }
 { $subsection push }
 { $subsection pop }
 { $subsection pop* }
index 9b0f4c1530a6b90eb10fa851cf3eab328a32a03d..36e4c95470be53f40283065ee776d67dbe5a8043 100755 (executable)
@@ -626,7 +626,7 @@ PRIVATE>
         [ 0 swap copy ] keep
     ] new-like ;
 
-: peek ( seq -- elt ) [ length 1 - ] [ nth ] bi ;
+: last ( seq -- elt ) [ length 1 - ] [ nth ] bi ;
 
 : pop* ( seq -- ) [ length 1 - ] [ shorten ] bi ;
 
@@ -821,7 +821,7 @@ PRIVATE>
     [ rest ] [ first-unsafe ] bi ;
 
 : unclip-last ( seq -- butlast last )
-    [ but-last ] [ peek ] bi ;
+    [ but-last ] [ last ] bi ;
 
 : unclip-slice ( seq -- rest-slice first )
     [ rest-slice ] [ first-unsafe ] bi ; inline
@@ -852,7 +852,7 @@ PRIVATE>
     [ find-last ] (map-find) ; inline
 
 : unclip-last-slice ( seq -- butlast-slice last )
-    [ but-last-slice ] [ peek ] bi ; inline
+    [ but-last-slice ] [ last ] bi ; inline
 
 : <flat-slice> ( seq -- slice )
     dup slice? [ { } like ] when
index 04b3e53422540408a93f250e0689296c905bbce3..5ec396e5ba6301376bc6f134f5c9581ad0ca8f3d 100644 (file)
@@ -75,7 +75,7 @@ M: string string-lines
             but-last-slice [
                 "\r" ?tail drop "\r" split
             ] map
-        ] keep peek "\r" split suffix concat
+        ] keep last "\r" split suffix concat
     ] [
         1array
     ] if ;
index 12e2ea49f78d250e24c668c84dc4631712ed8c5c..9052638e7da914b9e41c0b1e4a8d2d5b45c4388a 100644 (file)
@@ -62,7 +62,7 @@ IN: vectors.tests
 [ ] [ V{ 1 5 } "funny-stack" get push ] unit-test
 [ ] [ V{ 2 3 } "funny-stack" get push ] unit-test
 [ V{ 2 3 } ] [ "funny-stack" get pop ] unit-test
-[ V{ 1 5 } ] [ "funny-stack" get peek ] unit-test
+[ V{ 1 5 } ] [ "funny-stack" get last ] unit-test
 [ V{ 1 5 } ] [ "funny-stack" get pop ] unit-test
 [ "funny-stack" get pop ] must-fail
 [ "funny-stack" get pop ] must-fail
@@ -98,4 +98,4 @@ IN: vectors.tests
 
 [ fixnum ] [ 1 >bignum [ ] V{ } map-as length class ] unit-test
 
-[ V{ "lulz" } ] [ "lulz" 1vector ] unit-test
\ No newline at end of file
+[ V{ "lulz" } ] [ "lulz" 1vector ] unit-test
index 6561c55b6714f1236f664c242c4da8b5099a7a56..2c0f67641d15ef897aa1372b74b2f64dc8949f95 100644 (file)
@@ -39,7 +39,7 @@ PRIVATE>
 
 : vocab-dir+ ( vocab str/f -- path )
     [ vocab-name "." split ] dip
-    [ [ dup peek ] dip append suffix ] when*
+    [ [ dup last ] dip append suffix ] when*
     "/" join ;
 
 : find-vocab-root ( vocab -- path/f )
index ff55f8e68d67067b8081bfe45c2031d0587538f4..ca783c13e6ada1c01aa4c2c9e53ccf6161881f36 100644 (file)
@@ -193,7 +193,7 @@ TUPLE: ambiguous-use-error words ;
 
 : qualified-search ( name manifest -- word/f )
     qualified-vocabs>>
-    (vocab-search) 0 = [ drop f ] [ peek ] if ;
+    (vocab-search) 0 = [ drop f ] [ last ] if ;
 
 PRIVATE>
 
index 19928b2e0bf22d568d83eb951aa7b4f28d8d34d1..15c610ce7a6a5e5086ab23848730666e99097d3e 100644 (file)
@@ -40,7 +40,7 @@ SYMBOL: commands
     if ;
 DEFER: check-status
 : quit-game ( vector -- ) drop "you're a quitter" print ;
-: quit? ( vector -- t/f ) peek "quit" = ;
+: quit? ( vector -- t/f ) last "quit" = ;
 : end-game ( vector -- )
     dup victory? 
         [ drop "You WON!" ]
index a5c7dbdde427ad043c0c2856cc70841fbbe4dd69..8f416dc799c20426b53142438f4d44a6431434dc 100644 (file)
@@ -14,4 +14,4 @@ SYMBOL: sleep-period
 : set-end ( duration -- end-time ) duration>milliseconds millis + ;
 : loop ( quot end -- ) dup millis > [ [ dup call ] dip loop ] [ 2drop ] if ; inline
 : animate ( quot duration -- ) reset-progress set-end loop ; inline
-: sample ( revs quot -- avg ) reset-progress dupd times progress swap / ; inline
\ No newline at end of file
+: sample ( revs quot -- avg ) reset-progress dupd times progress swap / ; inline
index 9f1d8c31d294476a5c9f2001994f62b9641655f9..6fadcf76795105326f46fbee8038cdeeee13a919 100644 (file)
@@ -83,7 +83,7 @@ GENERIC: element-binary-read ( length type -- object )
     get-state element>> pop ; inline
 
 : peek-scope ( -- ht )
-    get-state scope>> peek ; inline
+    get-state scope>> last ; inline
 
 : read-elements ( -- )
     read-element-type
@@ -136,7 +136,7 @@ M: bson-not-eoo element-read ( type -- cont? )
     read-int32 drop
     get-state
     [scope-changer] change-scope
-    scope>> peek ; inline
+    scope>> last ; inline
     
 M: bson-object element-data-read ( type -- object )
     (object-data-read) ;
index 6d81f2a14b8a9b7d1911dda037c92c0d71fe3afe..f16664fb0272c19cba3296da89bf3f73c2567f15 100644 (file)
@@ -495,7 +495,7 @@ ERROR: name-error name ;
 : fully-qualified ( name -- name )
     {
       { [ dup empty?         ] [ "." append ] }
-      { [ dup peek CHAR: . = ] [            ] }
+      { [ dup last CHAR: . = ] [            ] }
       { [ t                  ] [ "." append ] }
     }
   cond ;
index 948bd0c954907eab4317306f411a635ca6ac5214..9fcbffd0db31daa220a9e18a125bb3c324cb70be 100644 (file)
@@ -21,7 +21,7 @@ SYMBOL: tagstack
 
 : closing-tag? ( string -- ? )
     [ f ]
-    [ { [ first CHAR: / = ] [ peek CHAR: / = ] } 1|| ] if-empty ;
+    [ { [ first CHAR: / = ] [ last CHAR: / = ] } 1|| ] if-empty ;
 
 : <tag> ( name attributes closing? -- tag )
     tag new
index 2006cc24c313c48ee41282261127dff0fcdb921f..d53ef6924b6a0518dff95bf1fd3ea05e89158ea3 100755 (executable)
@@ -65,7 +65,7 @@ IRC: rpl-nick-collision  "436" nickname : comment ;
 PREDICATE: channel-mode < mode name>> first "#&" member? ;
 PREDICATE: participant-mode < channel-mode parameter>> ;
 PREDICATE: ctcp < privmsg
-    trailing>> { [ length 1 > ] [ first 1 = ] [ peek 1 = ] } 1&& ;
+    trailing>> { [ length 1 > ] [ first 1 = ] [ last 1 = ] } 1&& ;
 PREDICATE: action < ctcp trailing>> rest "ACTION" head? ;
 
 M: rpl-names post-process-irc-message ( rpl-names -- )
index 7e124dc713b940d677d86a589b614df5e43ee149..59120cc5783ce8a07bcc3500acece5c4741b0ba6 100644 (file)
@@ -25,7 +25,7 @@ CONSTANT: random-rotation-angle $[ pi 20 / ]
 
 : (random-segments) ( segments n -- segments )
     dup 0 > [
-        [ dup peek random-segment over push ] dip 1- (random-segments)
+        [ dup last random-segment over push ] dip 1- (random-segments)
     ] [ drop ] if ;
 
 CONSTANT: default-segment-radius 1
index 9ed29aef45714a00e6277a931a6a6988a8dc2d01..5e99b15df5d51cbf3d439794ec6475110ee3f317 100644 (file)
@@ -45,7 +45,7 @@ builder "BUILDERS" {
 SYMBOLS: host-name target-os target-cpu message message-arg ;
 
 : parse-args ( command-line -- )
-    dup peek message-arg set
+    dup last message-arg set
     [
         {
             [ host-name set ]
index 218e56dfb5667f8760e1c136cea843bcd5b04f05..65f57be5146ab18064d6bc8fadf0690978986f3d 100644 (file)
@@ -5,7 +5,7 @@ IN: math.vectors.homogeneous
 : (homogeneous-xyz) ( h -- xyz )
     1 head* ; inline
 : (homogeneous-w) ( h -- w )
-    peek ; inline
+    last ; inline
 
 : h+ ( a b -- c )
     2dup [ (homogeneous-w) ] bi@ over =
index 15dd7ed6d2edfd1b6210b441af5ffb858d24f3b8..9ecf942ef669a88ee1a0b073cbf0f24e121edd85 100644 (file)
@@ -50,7 +50,7 @@ HINTS: count-digits fixnum ;
 
 : (find-unusual-terms) ( n seq -- seq/f )
     [ [ arithmetic-terms ] with map ] keep
-    '[ _ [ peek ] dip member? ] find nip ;
+    '[ _ [ last ] dip member? ] find nip ;
 
 : find-unusual-terms ( seq -- seq/? )
     unclip-slice over (find-unusual-terms) [
index 9a2fb8c868a48f1c53a7ac6de43a6edcecbb85b7..1fb5c7c8bbd8328b3ade34d079d0853441387e71 100644 (file)
@@ -75,7 +75,7 @@ INSTANCE: rollover immutable-sequence
     ] { } make nip ; inline
 
 : most-frequent ( seq -- elt )
-    frequency-analysis sort-values keys peek ;
+    frequency-analysis sort-values keys last ;
 
 : crack-key ( seq key-length -- key )
     [ " " decrypt ] dip group but-last-slice
index 174618e1471723c5b76abea869240e7be17d1c59..2766322323c6e8573f9698436371515a3baf9675 100644 (file)
@@ -41,10 +41,10 @@ IN: project-euler.116
     [ length swap - 1- ] keep ?nth 0 or ;
 
 : next ( colortile seq -- )
-     [ nth* ] [ peek + ] [ push ] tri ;
+     [ nth* ] [ last + ] [ push ] tri ;
 
 : ways ( length colortile -- permutations )
-    V{ 1 } clone [ [ next ] 2curry times ] keep peek 1- ;
+    V{ 1 } clone [ [ next ] 2curry times ] keep last 1- ;
 
 : (euler116) ( length -- permutations )
     3 [1,b] [ ways ] with sigma ;
index cb485d3ce237fbef8b8fff6d32c19a73cc2e5b9a..0d4ec782269f4b1d4777da7e7dd8045c06ccc1ff 100644 (file)
@@ -31,7 +31,7 @@ IN: project-euler.117
     [ 4 short tail* sum ] keep push ;
 
 : (euler117) ( n -- m )
-    V{ 1 } clone tuck [ next ] curry times peek ;
+    V{ 1 } clone tuck [ next ] curry times last ;
 
 PRIVATE>
 
index cea1472c0bf67095ce32fb0b9803367361044df1..af8b7e49c064d3de79794f7602ce04f4edf0dbc7 100644 (file)
@@ -18,7 +18,7 @@ IN: project-euler.164
 <PRIVATE
 
 : next-keys ( key -- keys )
-    [ peek ] [ 10 swap sum - ] bi [ 2array ] with map ;
+    [ last ] [ 10 swap sum - ] bi [ 2array ] with map ;
 
 : next-table ( assoc -- assoc )
     H{ } clone swap