mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 06:20:23 +02:00
* srfi-1.scm (list-tabulate): Do not go into infinite loop for
invalid arguments.
This commit is contained in:
parent
7beabedb0a
commit
018adcae03
2 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2001-07-03 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
|
||||||
|
|
||||||
|
* srfi-1.scm (list-tabulate): Do not go into infinite loop for
|
||||||
|
invalid arguments.
|
||||||
|
|
||||||
2001-07-02 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
|
2001-07-02 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
|
||||||
|
|
||||||
* srfi-1.scm: Replaced calls to `map' in several procedures to
|
* srfi-1.scm: Replaced calls to `map' in several procedures to
|
||||||
|
|
|
@ -242,7 +242,7 @@
|
||||||
|
|
||||||
(define (list-tabulate n init-proc)
|
(define (list-tabulate n init-proc)
|
||||||
(let lp ((n n) (acc '()))
|
(let lp ((n n) (acc '()))
|
||||||
(if (zero? n)
|
(if (<= n 0)
|
||||||
acc
|
acc
|
||||||
(lp (- n 1) (cons (init-proc (- n 1)) acc)))))
|
(lp (- n 1) (cons (init-proc (- n 1)) acc)))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue