Debian Codegraph @

benchmarks.larceny/src/diviter.scm

raw
1 ;;; DIVITER -- Benchmark which divides by 2 using lists of n ()'s.
2
3 (define (create-n n)
4 (do ((n n (- n 1))
5 (a '() (cons '() a)))
6 ((= n 0) a)))
7
8 (define *ll* (create-n 200))
9
10 (define (iterative-div2 l)
11 (do ((l l (cddr l))
12 (a '() (cons (car l) a)))
13 ((null? l) a)))
14
15 (define (main . args)
16 (run-benchmark
17 "diviter"
18 diviter-iters
19 (lambda (result)
20 (equal? result
21 '(() () () () () () () () () () () () () () () () () () () ()
22 () () () () () () () () () () () () () () () () () () () ()
23 () () () () () () () () () () () () () () () () () () () ()
24 () () () () () () () () () () () () () () () () () () () ()
25 () () () () () () () () () () () () () () () () () () () ())))
26 (lambda (l) (lambda () (iterative-div2 l)))
27 *ll*))