Allow string-map to accept multiple lists

This commit is contained in:
Justin Ethier 2016-02-12 23:45:04 -05:00
parent 0f8f6c2efe
commit 7aa7a8fefb

View file

@ -735,8 +735,9 @@
(string-set! str i fill)
(loop (+ i 1)))))))
(loop start)))
(define (string-map func str)
(list->string (map func (string->list str))))
(define (string-map func str1 . strs)
(list->string
(apply map `(,func ,(string->list str1) ,@(map string->list strs)))))
(define (string-for-each func str)
(for-each func (string->list str)))
(define (vector-map func vec)