]> gitweb.factorcode.org Git - factor.git/blob - extra/partial-continuations/partial-continuations-tests.factor
fb7f00f62912d0a69591202e782ba2fbc5e98f47
[factor.git] / extra / partial-continuations / partial-continuations-tests.factor
1 USING: namespaces math partial-continuations tools.test
2 kernel sequences fry ;
3 IN: partial-continuations.tests
4
5 SYMBOL: sum
6
7 : range ( r from to -- n )
8     over - 1 + rot [ 
9         '[ over + @ drop ] each-integer drop f
10     ] bshift 2nip ; inline
11
12 [ 55 ] [
13     0 sum set 
14     [ 1 10 range sum get + sum set f ] breset drop
15     sum get
16 ] unit-test