From: Jon Wilson <[EMAIL PROTECTED]> Subject: Re: [r6rs-discuss] Strings Date: Mon, 26 Mar 2007 15:00:32 -0500
> Hi Peter, > > Peter Gavin wrote: > > I'm pretty sure this has been said before, but I personally think the > > string API should be representation agnostic. > I would tend to agree with you, but the problem with that approach is > that then the report cannot make any guarantees on the complexity of the > various operations it specifies. I'm sure you could make an argument > that it shouldn't make any such guarantees, but the fact remains that > you can't get something (representation agnostic report) for nothing > (not losing complexity guarantees) here. How about the third option: The report can suggest certain complexity properties in common implementation, but does not requre them. Portable library writers can assume such properties. An implementation can make a different choice, though, to optimize for very specific domain even that makes portable libraries run very slowly. That's the implementation's problem; either the implementation lives with slow libraries or provides alternative to them. My opinion is, however, there's not much point to provide "optimized" portable string search library using string-ref assuming O(1) access; the implementation can provide far more efficient high-level search library, taking advantage of whatever implementation strategy it uses. --shiro _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
