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 <[EMAIL PROTECTED]>
--Edsger W. Dijkstra's advice
to a student in search of a thesis
_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss