(let num->occ (table [for i 0 9 (= _.i 0)]) (repeat 1000000 ; 1 million iterations (++ (num->occ (mod (rand 15) 10)))) (each k (sort < (keys num->occ)) (prn k "\t" (num->occ k))))
Just for information:
$ time perl < test-rand15.pl 0m1.545s $ time mzscheme -m -f as.scm < test-rand15.arc 0m17.374s $ time java -jar rainbow.jar < test-rand15.arc2 0m32.104s