2 USING: assembler compiler compiler-backend generic inference
3 kernel kernel-internals lists math prettyprint sequences strings
7 ! [ 3 ] [ 1 2 3 (subst-value) ] unit-test
8 ! [ 1 ] [ 1 2 2 (subst-value) ] unit-test
10 ! [ { "one" "one" "three" "three" } ]
12 ! { "one" "two" "three" } { 1 2 3 } { 1 1 3 3 }
13 ! clone [ (subst-values) ] keep
16 ! [ << meet f { "one" 2 3 } >> ]
17 ! [ "one" 1 << meet f { 1 2 3 } >> clone (subst-value) ] unit-test
21 dataflow kill-set [ literal-value ] map ;
25 [ { } ] [ \ foo word-def dataflow kill-set ] unit-test
27 [ { [ 1 ] [ 2 ] } ] [ [ [ 1 ] [ 2 ] ifte ] kill-set* ] unit-test
29 [ { [ 1 ] [ 2 ] } ] [ [ [ 1 ] [ 2 ] ifte ] kill-set* ] unit-test
31 : literal-kill-test-1 4 compiled-offset cell 2 * - ; compiled
33 [ 4 ] [ literal-kill-test-1 drop ] unit-test
35 : literal-kill-test-2 3 compiled-offset cell 2 * - ; compiled
37 [ 3 ] [ literal-kill-test-2 drop ] unit-test
39 : literal-kill-test-3 10 3 /mod drop ; compiled
41 [ 3 ] [ literal-kill-test-3 ] unit-test
43 [ { [ 3 ] [ dup ] 3 } ] [ [ [ 3 ] [ dup ] ifte drop ] kill-set* ] unit-test
46 5 swap [ 3 ] [ dup ] ifte 2drop ; compiled
48 [ ] [ t literal-kill-test-4 ] unit-test
49 [ ] [ f literal-kill-test-4 ] unit-test
51 [ { 5 [ 3 ] [ dup ] 3 } ] [ \ literal-kill-test-4 word-def kill-set* ] unit-test
54 5 swap [ 5 ] [ dup ] ifte 2drop ; compiled
56 [ ] [ t literal-kill-test-5 ] unit-test
57 [ ] [ f literal-kill-test-5 ] unit-test
59 [ { 5 [ 5 ] [ dup ] 5 } ] [ \ literal-kill-test-5 word-def kill-set* ] unit-test
62 5 swap [ dup ] [ dup ] ifte 2drop ; compiled
64 [ ] [ t literal-kill-test-6 ] unit-test
65 [ ] [ f literal-kill-test-6 ] unit-test
67 [ { 5 [ dup ] [ dup ] } ] [ \ literal-kill-test-6 word-def kill-set* ] unit-test
70 [ 1 2 3 ] >r + r> drop ; compiled
72 [ 4 ] [ 2 2 literal-kill-test-7 ] unit-test
74 ! Test method inlining
77 [ repeated integer string mirror array reversed sbuf
78 slice vector diagonal general-list ]
84 [ fixnum integer letter ]
90 [ fixnum integer object ]
96 [ integer float object ]
102 [ integer float object ]
109 [ ] [ \ xyz compile ] unit-test
111 ! Test predicate inlining
114 dup general-list? [ "general-list" ] [ "nope" ] ifte
119 [ [[ 1 2 ]] "general-list" ] [ [[ 1 2 ]] pred-test-1 ] unit-test
123 dup integer? [ "integer" ] [ "nope" ] ifte
128 [ 1 "integer" ] [ 1 pred-test-2 ] unit-test
134 dup pred-test? [ "pred-test" ] [ "nope" ] ifte
139 [ << pred-test >> "pred-test" ] [ << pred-test >> pred-test-3 ] unit-test
143 dup tuple? [ "pred-test" ] [ "nope" ] ifte
148 [ << pred-test >> "pred-test" ] [ << pred-test >> pred-test-4 ] unit-test
153 [ t ] [ "nom" inline-test ] unit-test
154 [ f ] [ "shayin" inline-test ] unit-test
155 [ f ] [ 3 inline-test ] unit-test
157 : fixnum-declarations >fixnum 24 shift 1234 bitxor ; compiled
159 [ ] [ 1000000 fixnum-declarations . ] unit-test
163 : literal-not-branch 0 not [ ] [ ] ifte ; compiled
165 [ ] [ literal-not-branch ] unit-test