From: Joe Groff Date: Fri, 6 Nov 2009 04:47:05 +0000 (-0600) Subject: deprimitivize tuck and put it to pasture X-Git-Tag: 0.97~5170 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=00ce8b6a33f34e361d9ff8e36252fd9eed4e4113 deprimitivize tuck and put it to pasture --- diff --git a/basis/compiler/tests/intrinsics.factor b/basis/compiler/tests/intrinsics.factor index a26ba5a27a..b2159e9c09 100755 --- a/basis/compiler/tests/intrinsics.factor +++ b/basis/compiler/tests/intrinsics.factor @@ -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 diff --git a/basis/compiler/tree/debugger/debugger.factor b/basis/compiler/tree/debugger/debugger.factor index 4bf4cf88f0..63f145d752 100644 --- a/basis/compiler/tree/debugger/debugger.factor +++ b/basis/compiler/tree/debugger/debugger.factor @@ -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 ] } diff --git a/basis/compiler/tree/propagation/recursive/recursive-tests.factor b/basis/compiler/tree/propagation/recursive/recursive-tests.factor index 974bb584eb..42325d97ca 100644 --- a/basis/compiler/tree/propagation/recursive/recursive-tests.factor +++ b/basis/compiler/tree/propagation/recursive/recursive-tests.factor @@ -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 diff --git a/basis/cpu/ppc/bootstrap.factor b/basis/cpu/ppc/bootstrap.factor index c16d564e13..5d3caca206 100644 --- a/basis/cpu/ppc/bootstrap.factor +++ b/basis/cpu/ppc/bootstrap.factor @@ -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 diff --git a/basis/cpu/x86/bootstrap.factor b/basis/cpu/x86/bootstrap.factor index 98a5188962..c993a1fdec 100644 --- a/basis/cpu/x86/bootstrap.factor +++ b/basis/cpu/x86/bootstrap.factor @@ -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 diff --git a/basis/inverse/inverse.factor b/basis/inverse/inverse.factor index 1e941afed0..4ecb1e12a8 100755 --- a/basis/inverse/inverse.factor +++ b/basis/inverse/inverse.factor @@ -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 diff --git a/basis/shuffle/shuffle-docs.factor b/basis/shuffle/shuffle-docs.factor index ebb87eda7a..363727a6c5 100644 --- a/basis/shuffle/shuffle-docs.factor +++ b/basis/shuffle/shuffle-docs.factor @@ -4,3 +4,4 @@ IN: shuffle HELP: spin $complex-shuffle ; HELP: roll $complex-shuffle ; HELP: -roll $complex-shuffle ; +HELP: tuck $complex-shuffle ; diff --git a/basis/shuffle/shuffle.factor b/basis/shuffle/shuffle.factor index 4388aedb3e..0ff41edec6 100644 --- a/basis/shuffle/shuffle.factor +++ b/basis/shuffle/shuffle.factor @@ -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 diff --git a/basis/stack-checker/known-words/known-words.factor b/basis/stack-checker/known-words/known-words.factor index 26b122257f..db492f97fe 100644 --- a/basis/stack-checker/known-words/known-words.factor +++ b/basis/stack-checker/known-words/known-words.factor @@ -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 )) } diff --git a/core/bootstrap/primitives.factor b/core/bootstrap/primitives.factor index 07e5eee1c3..702590516c 100644 --- a/core/bootstrap/primitives.factor +++ b/core/bootstrap/primitives.factor @@ -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 )) } diff --git a/core/kernel/kernel-docs.factor b/core/kernel/kernel-docs.factor index 7327285ffd..9a4fd4495a 100644 --- a/core/kernel/kernel-docs.factor +++ b/core/kernel/kernel-docs.factor @@ -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