HCoop
/
bpt
/
guile.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fa5518d
)
* boot-9.scm (iota): replaced by a tail recursive version.
author
Mikael Djurfeldt
<djurfeldt@nada.kth.se>
Sat, 5 Jun 1999 05:59:26 +0000
(
05:59
+0000)
committer
Mikael Djurfeldt
<djurfeldt@nada.kth.se>
Sat, 5 Jun 1999 05:59:26 +0000
(
05:59
+0000)
(reverse-iota): removed.
ice-9/boot-9.scm
patch
|
blob
|
blame
|
history
diff --git
a/ice-9/boot-9.scm
b/ice-9/boot-9.scm
index
edf06ce
..
65eb43b
100644
(file)
--- a/
ice-9/boot-9.scm
+++ b/
ice-9/boot-9.scm
@@
-2802,8
+2802,10
@@
\f
;;; {IOTA functions: generating lists of numbers}
-(define (reverse-iota n) (if (> n 0) (cons (1- n) (reverse-iota (1- n))) '()))
-(define (iota n) (reverse! (reverse-iota n)))
+(define (iota n)
+ (let loop ((count (1- n)) (result '()))
+ (if (< count 0) result
+ (loop (1- count) (cons count result)))))
\f
;;; {While}