[r6rs-discuss] Re: [Formal] formal comment (ports, characters, strings, Unicode)
> > 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))))
That works as long as string->list doesn't call string-ref. :-) And if it
doesn't call string-ref it probably calls the procedure we're looking for.
Received on Tue Mar 20 2007 - 17:05:37 UTC
This archive was generated by hypermail 2.3.0
: Wed Oct 23 2024 - 09:15:01 UTC