]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/tests/redefine15.factor
ui.listener: document that ~/.factor-history persists input history
[factor.git] / basis / compiler / tests / redefine15.factor
1 USING: compiler.units words tools.test math kernel ;
2 IN: compiler.tests.redefine15
3
4 DEFER: word-1
5
6 : word-2 ( a -- b ) word-1 ;
7
8 [ \ word-1 [ ] ( a -- b ) define-declared ] with-compilation-unit
9
10 { "a" } [ "a" word-2 ] unit-test
11
12 : word-3 ( a -- b ) 1 + ;
13
14 : word-4 ( a -- b c ) 0 swap word-3 swap 1 + ;
15
16 { 1 1 } [ 0 word-4 ] unit-test
17
18 [ \ word-3 [ [ 2 + ] bi@ ] ( a b -- c d ) define-declared ] with-compilation-unit
19
20 { 2 3 } [ 0 word-4 ] unit-test