whalesong/examples/list-length.rkt
2012-02-10 14:24:42 -05:00

13 lines
256 B
Racket

#lang planet dyoo/whalesong
(define (mylen x acc)
(cond
[(empty? x)
acc]
[else
(mylen (rest x) (add1 acc))]))
"computing length"
(define v (build-list 1000000 (lambda (i) i)))
(printf "Built list\n")
(mylen v 0)
"done computing length"