pick pick is 2over

db4
Slava Pestov 2008-02-16 18:50:26 -06:00
parent 9c684bf1c5
commit 8c9966b17c
8 changed files with 8 additions and 8 deletions
extra
benchmark
math/vectors
parser-combinators
xmode/marker/state

View File

@ -6,7 +6,7 @@ arrays namespaces io ;
2dup length >= [
3drop
] [
f pick pick set-nth-unsafe >r over + r> clear-flags
f 2over set-nth-unsafe >r over + r> clear-flags
] if ; inline
: (nsieve) ( count i seq -- count )

View File

@ -16,7 +16,7 @@ USING: math kernel hints prettyprint io ;
] if ;
: tak ( x y z -- t )
pick pick swap < [
2over swap < [
[ rot 1- -rot tak ] 3keep
[ -rot 1- -rot tak ] 3keep
1- -rot tak

View File

@ -43,7 +43,7 @@ TUPLE: document locs ;
] if ;
: each-line ( from to quot -- )
pick pick = [
2over = [
3drop
] [
>r [ first ] 2apply 1+ dup <slice> r> each

View File

@ -64,7 +64,7 @@ C: <extended-header> extended-header
} cond ;
: (read-frame) ( id -- frame )
read-frame-size read-frame-flags pick pick read-frame-data <frame> ;
read-frame-size read-frame-flags 2over read-frame-data <frame> ;
: read-frame ( -- frame/f )
read-frame-id dup good-frame-id? [ (read-frame) ] [ drop f ] if ;

View File

@ -25,7 +25,7 @@ IN: math.vectors
: normalize ( u -- v ) dup norm v/n ;
: set-axis ( u v axis -- w )
dup length [ >r zero? pick pick ? r> swap nth ] 2map 2nip ;
dup length [ >r zero? 2over ? r> swap nth ] 2map 2nip ;
HINTS: vneg { float-array } { array } ;
HINTS: norm-sq { float-array } { array } ;

View File

@ -38,7 +38,7 @@ C: <parse-result> parse-result
[ [ >upper ] 2apply ] when sequence= ;
: string-head? ( str head ignore-case -- ? )
pick pick shorter? [
2over shorter? [
3drop f
] [
>r [ length head-slice ] keep r> string=

View File

@ -35,7 +35,7 @@ DEFER: search
{ [ t ] [ assume ] }
} cond ;
: solve ( x y -- ) 9 [ 1+ pick pick attempt ] each 2drop ;
: solve ( x y -- ) 9 [ 1+ 2over attempt ] each 2drop ;
: board. ( board -- )
standard-table-style [

View File

@ -26,7 +26,7 @@ SYMBOL: delegate-end-escaped?
current-rule-set rule-set-keywords ;
: token, ( from to id -- )
pick pick = [ 3drop ] [ >r line get subseq r> <token> , ] if ;
2over = [ 3drop ] [ >r line get subseq r> <token> , ] if ;
: prev-token, ( id -- )
>r last-offset get position get r> token,