Change "3dup drop" to "2over".

db4
John Benediktsson 2012-10-22 20:45:15 -07:00
parent dd6d1e50cf
commit 87f55eb033
7 changed files with 8 additions and 8 deletions

View File

@ -83,8 +83,8 @@ M: gif-lzw increment-code-size [ 1 + 12 min ] change-code-size ;
DEFER: handle-clear-code DEFER: handle-clear-code
: lzw-process-next-code ( lzw quot: ( lzw code -- ) -- ) : lzw-process-next-code ( lzw quot: ( lzw code -- ) -- )
[ lzw-read ] dip { [ lzw-read ] dip {
{ [ 3dup drop end-of-information? ] [ 3drop ] } { [ 2over end-of-information? ] [ 3drop ] }
{ [ 3dup drop clear-code? ] [ 2drop handle-clear-code ] } { [ 2over clear-code? ] [ 2drop handle-clear-code ] }
[ call( lzw code -- ) ] [ call( lzw code -- ) ]
} cond ; inline } cond ; inline

View File

@ -17,7 +17,7 @@ GENERIC: cancel-operation ( obj -- )
[ '[ _ cancel-operation ] ] dip later ; [ '[ _ cancel-operation ] ] dip later ;
: with-timeout* ( obj timeout quot -- ) : with-timeout* ( obj timeout quot -- )
3dup drop queue-timeout [ nip call ] dip stop-timer ; 2over queue-timeout [ nip call ] dip stop-timer ;
inline inline
: with-timeout ( obj quot -- ) : with-timeout ( obj quot -- )

View File

@ -37,7 +37,7 @@ PRIVATE>
GENERIC: sift-down ( value prio left right -- heap ) GENERIC: sift-down ( value prio left right -- heap )
: singleton-sift-down ( value prio singleton empty -- heap ) : singleton-sift-down ( value prio singleton empty -- heap )
3dup drop prio>> <= [ <branch> ] [ 2over prio>> <= [ <branch> ] [
drop -rot [ [ value>> ] [ prio>> ] bi ] 2dip drop -rot [ [ value>> ] [ prio>> ] bi ] 2dip
<singleton-heap> <persistent-heap> <branch> <singleton-heap> <persistent-heap> <branch>
] if ; ] if ;

View File

@ -43,7 +43,7 @@ IN: regexp.dfa
[ tagged-epsilon? not ] filter ; [ tagged-epsilon? not ] filter ;
: add-todo-state ( state visited-states new-states -- ) : add-todo-state ( state visited-states new-states -- )
3dup drop key? [ 3drop ] [ 2over key? [ 3drop ] [
[ conjoin ] [ push ] bi-curry* bi [ conjoin ] [ push ] bi-curry* bi
] if ; ] if ;

View File

@ -272,7 +272,7 @@ IN: tools.deploy.shaker
_ _ _ _
{ {
! old becomes new ! old becomes new
{ [ 3dup drop eq? ] [ 2nip ] } { [ 2over eq? ] [ 2nip ] }
! recurse into arrays ! recurse into arrays
{ [ pick array? ] [ [ dup ] 2dip recursive-subst ] } { [ pick array? ] [ [ dup ] 2dip recursive-subst ] }
! otherwise do nothing ! otherwise do nothing

View File

@ -91,7 +91,7 @@ M: set all-unique? drop t ;
<PRIVATE <PRIVATE
: (pruned) ( elt hash vec -- ) : (pruned) ( elt hash vec -- )
3dup drop in? [ 3drop ] [ 2over in? [ 3drop ] [
[ drop adjoin ] [ nip push ] 3bi [ drop adjoin ] [ nip push ] 3bi
] if ; inline ] if ; inline

View File

@ -30,7 +30,7 @@ DEFER: search
: attempt ( n x y -- ) : attempt ( n x y -- )
{ {
{ [ 3dup nip row-any? ] [ 3drop ] } { [ 3dup nip row-any? ] [ 3drop ] }
{ [ 3dup drop col-any? ] [ 3drop ] } { [ 2over col-any? ] [ 3drop ] }
{ [ 3dup box-any? ] [ 3drop ] } { [ 3dup box-any? ] [ 3drop ] }
[ assume ] [ assume ]
} cond ; } cond ;