X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=jars.git;a=blobdiff_plain;f=run-mars.scm;h=30b9e5c9e8d6a89e16599d0ffb2875ff264cb22b;hp=db5a8b5f486c0e7323344251f6097ac60035a7f3;hb=f04e111b74b209662ce341affd77de866f7fdcac;hpb=5dd63750e8c44fb6fbf2c8c0b1c01ef564d08f99 diff --git a/run-mars.scm b/run-mars.scm index db5a8b5..30b9e5c 100644 --- a/run-mars.scm +++ b/run-mars.scm @@ -12,11 +12,13 @@ (colors-left colors)) (if (null? progs-left) entries - (let ((this-prog (car progs-left)) - (this-col (car colors-left))) - (loop (cons (cons (prog-name this-prog) this-col) entries) - (cdr progs-left) - (cdr colors-left)))))) + (if (null? colors-left) + (error "Not enough colours in colour map!") + (let ((this-prog (car progs-left)) + (this-col (car colors-left))) + (loop (cons (cons (prog-name this-prog) this-col) entries) + (cdr progs-left) + (cdr colors-left))))))) (define (mars-runner files iters core-size visualization) (print "Iters: " iters ", core size: " core-size) @@ -64,4 +66,5 @@ (loop rest iters core-size #f)) ((files ...) (mars-runner files iters core-size visualization))))) + (main)