[r6rs-discuss] Re: [Formal] formal comment (ports, characters, strings, Unicode)

R. Kent Dybvig dyb at cs.indiana.edu
Tue Mar 20 16:25:54 EDT 2007


> However, we can obviously do much better if we
> have a string-for-each procedure that is O(N).  Unfortunately, we have
> no portable way to write this procedure without string-ref.

What about:

(define string-for-each
  (lambda (p s)
    (for-each p (string->list s))))

Kent



More information about the r6rs-discuss mailing list