Commit a99d4dcc authored by Erick's avatar Erick

Avoid consing in string-fo-each and vector-for-each.

parent 0714863e
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
;;;; ;;;;
;;;; Author: Erick Gallesio [eg@unice.fr] ;;;; Author: Erick Gallesio [eg@unice.fr]
;;;; Creation date: 17-Apr-2011 19:36 (eg) ;;;; Creation date: 17-Apr-2011 19:36 (eg)
;;;; Last file update: 13-Sep-2018 15:49 (eg) ;;;; Last file update: 12-Oct-2018 11:47 (eg)
;;;; ;;;;
...@@ -611,8 +611,7 @@ doc> ...@@ -611,8 +611,7 @@ doc>
(error 'string-for-each "bad string ~S" x)) (error 'string-for-each "bad string ~S" x))
(string->list x)) (string->list x))
strings))) strings)))
(apply map proc strs) (apply for-each proc strs)))
(void)))
#| #|
...@@ -639,8 +638,8 @@ doc> ...@@ -639,8 +638,8 @@ doc>
(define (vector-for-each proc . vectors) (define (vector-for-each proc . vectors)
(unless (every vector? vectors) (unless (every vector? vectors)
(error 'vector-for-each "bad list of vectors ~S" vectors)) (error 'vector-for-each "bad list of vectors ~S" vectors))
(apply map proc (map vector->list vectors)) (apply for-each proc (map vector->list vectors)))
(void))
;;;; ---------------------------------------------------------------------- ;;;; ----------------------------------------------------------------------
;;;; 6.13 Input and Output ;;;; 6.13 Input and Output
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment