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