deprimitivize tuck and put it to pasture

db4
Joe Groff 2009-11-05 22:47:05 -06:00
parent 4b0edb34d3
commit 00ce8b6a33
11 changed files with 7 additions and 26 deletions

View File

@ -21,7 +21,6 @@ IN: compiler.tests.intrinsics
[ 2 1 3 ] [ 1 2 3 [ swapd ] compile-call ] unit-test
[ 2 ] [ 1 2 [ nip ] compile-call ] unit-test
[ 3 ] [ 1 2 3 [ 2nip ] compile-call ] unit-test
[ 2 1 2 ] [ 1 2 [ tuck ] compile-call ] unit-test
[ 1 2 1 ] [ 1 2 [ over ] compile-call ] unit-test
[ 1 2 3 1 ] [ 1 2 3 [ pick ] compile-call ] unit-test
[ 2 1 ] [ 1 2 [ swap ] compile-call ] unit-test

View File

@ -51,7 +51,6 @@ MATCH-VARS: ?a ?b ?c ;
{ { { ?b ?a } { ?a ?b } } [ swap ] }
{ { { ?b ?a ?c } { ?a ?b ?c } } [ swapd ] }
{ { { ?a ?b } { ?a ?a ?b } } [ dupd ] }
{ { { ?a ?b } { ?b ?a ?b } } [ tuck ] }
{ { { ?a ?b ?c } { ?a ?b ?c ?a } } [ pick ] }
{ { { ?a ?b ?c } { ?c ?a ?b } } [ -rot ] }
{ { { ?a ?b ?c } { ?b ?c ?a } } [ rot ] }

View File

@ -27,14 +27,16 @@ IN: compiler.tree.propagation.recursive.tests
] unit-test
[ t ] [
T{ interval f { -268435456 t } { 268435455 t } }
T{ interval f { 1 t } { 268435455 t } }
T{ interval f { -268435456 t } { 268435455 t } } tuck
over
integer generalize-counter-interval =
] unit-test
[ t ] [
T{ interval f { -268435456 t } { 268435455 t } }
T{ interval f { 1 t } { 268435455 t } }
T{ interval f { -268435456 t } { 268435455 t } } tuck
over
fixnum generalize-counter-interval =
] unit-test

View File

@ -329,14 +329,6 @@ CONSTANT: rs-reg 14
3 ds-reg 4 STWU
] \ dupd define-sub-primitive
[
3 ds-reg 0 LWZ
4 ds-reg -4 LWZ
3 ds-reg 4 STWU
4 ds-reg -4 STW
3 ds-reg -8 STW
] \ tuck define-sub-primitive
[
3 ds-reg 0 LWZ
4 ds-reg -4 LWZ

View File

@ -335,15 +335,6 @@ big-endian off
ds-reg [] temp0 MOV
] \ dupd define-sub-primitive
[
temp0 ds-reg [] MOV
temp1 ds-reg -1 bootstrap-cells [+] MOV
ds-reg bootstrap-cell ADD
ds-reg [] temp0 MOV
ds-reg -1 bootstrap-cells [+] temp1 MOV
ds-reg -2 bootstrap-cells [+] temp0 MOV
] \ tuck define-sub-primitive
[
temp0 ds-reg [] MOV
temp1 ds-reg bootstrap-cell neg [+] MOV

View File

@ -141,7 +141,6 @@ MACRO: undo ( quot -- ) [undo] ;
\ 2dup [ over =/fail over =/fail ] define-inverse
\ 3dup [ pick =/fail pick =/fail pick =/fail ] define-inverse
\ pick [ [ pick ] dip =/fail ] define-inverse
\ tuck [ swapd [ =/fail ] keep ] define-inverse
\ bi@ 1 [ [undo] '[ _ bi@ ] ] define-pop-inverse
\ tri@ 1 [ [undo] '[ _ tri@ ] ] define-pop-inverse

View File

@ -4,3 +4,4 @@ IN: shuffle
HELP: spin $complex-shuffle ;
HELP: roll $complex-shuffle ;
HELP: -roll $complex-shuffle ;
HELP: tuck $complex-shuffle ;

View File

@ -22,6 +22,8 @@ MACRO: shuffle-effect ( effect -- )
SYNTAX: shuffle(
")" parse-effect suffix! \ shuffle-effect suffix! ;
: tuck ( x y -- y x y ) swap over ; inline deprecated
: spin ( x y z -- z y x ) swap rot ; inline deprecated
: roll ( x y z t -- y z t x ) [ rot ] dip swap ; inline deprecated

View File

@ -43,7 +43,6 @@ IN: stack-checker.known-words
{ swapd (( x y z -- y x z )) }
{ nip (( x y -- y )) }
{ 2nip (( x y z -- z )) }
{ tuck (( x y -- y x y )) }
{ over (( x y -- x y x )) }
{ pick (( x y z -- x y z x )) }
{ swap (( x y -- y x )) }

View File

@ -340,7 +340,6 @@ tuple
{ "swapd" "kernel" (( x y z -- y x z )) }
{ "nip" "kernel" (( x y -- y )) }
{ "2nip" "kernel" (( x y z -- z )) }
{ "tuck" "kernel" (( x y -- y x y )) }
{ "over" "kernel" (( x y -- x y x )) }
{ "pick" "kernel" (( x y z -- x y z x )) }
{ "swap" "kernel" (( x y -- y x )) }

View File

@ -25,7 +25,6 @@ HELP: rot ( x y z -- y z x ) $complex-shuffle ;
HELP: -rot ( x y z -- z x y ) $complex-shuffle ;
HELP: dupd ( x y -- x x y ) $complex-shuffle ;
HELP: swapd ( x y z -- y x z ) $complex-shuffle ;
HELP: tuck ( x y -- y x y ) $complex-shuffle ;
HELP: datastack ( -- ds )
{ $values { "ds" array } }
@ -820,7 +819,6 @@ $nl
"Duplicating stack elements deep in the stack:"
{ $subsections
dupd
tuck
}
"Permuting stack elements deep in the stack:"
{ $subsections