From: Jon Wilson <j85wilson_at_fastmail.fm>
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
Received on Mon Mar 26 2007 - 16:33:35 UTC
This archive was generated by hypermail 2.3.0
: Wed Oct 23 2024 - 09:15:01 UTC