fixing the default start in iota

This commit is contained in:
Alex Shinn 2010-01-22 11:57:07 +09:00
parent 372aabb636
commit bd1e861afa

View file

@ -27,7 +27,7 @@
res)) res))
(define (iota count . o) (define (iota count . o)
(let ((start (if (pair? o) (car o) count)) (let ((start (if (pair? o) (car o) 0))
(step (if (and (pair? o) (pair? (cdr o))) (cadr o) 1))) (step (if (and (pair? o) (pair? (cdr o))) (cadr o) 1)))
(let lp ((i count) (n (+ start (* (- count 1) step))) (res '())) (let lp ((i count) (n (+ start (* (- count 1) step))) (res '()))
(if (<= i 0) (if (<= i 0)