2 USING: functors tools.test math words kernel ;
6 FUNCTOR: define-box ( T -- )
13 TUPLE: B { value T } ;
23 { 1 0 } [ define-box ] must-infer-as
25 [ T{ float-box f 5.0 } ] [ 5.0 <float-box> ] unit-test
28 [ execute ] [ execute ] bi ; inline
31 FUNCTOR: wrapper-test ( W -- )
37 : WW ( a -- b ) \ W twice ; inline
47 [ 16 ] [ 2 sqsq ] unit-test
51 FUNCTOR: wrapper-test-2 ( W -- )
57 : W ( a b -- c ) \ + execute ;
65 [ 4 ] [ 1 3 blah ] unit-test