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

From: John Cowan <cowan>
Date: Tue Mar 20 16:37:41 2007

R. Kent Dybvig scripsit:

> > 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))))

My discussion was meant to assume constant space; if not for space
issues, there is no need for strings at all, as lists and vectors
of characters can do all the work.

-- 
Only do what only you can do.               John Cowan <cowan_at_ccil.org>
  --Edsger W. Dijkstra's advice
    to a student in search of a thesis
Received on Tue Mar 20 2007 - 16:37:36 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC