Re: [Scheme-reports] Requesting early review of a character sequence library Per Bothner (19 Dec 2014 01:17 UTC)

Re: [Scheme-reports] Requesting early review of a character sequence library Per Bothner 19 Dec 2014 01:13 UTC

I didn't find any mention of spans over mutable strings.
One can make it undefined, or an error; if the latter, is it one that needs to be caught?
(For example, each string and span could have a timestamp: the string timestamp
is increment when it is modified; a span timestamp copies that of the underlying
string when the span is created; a span is invalid if its timestamp is less than
the underlying string.  Or just make it caveat programmer, which would be my preference.)

Is this proposed as part of a future Scheme specification? I really hope not.
I find the duplicate set of procedures a very ugly API, and would be strongly against
any language standard that has (for example) both string-any and span-any,
or even both span-ref and string-ref.  What does this API give me that
substring/shared doesn't?  Of course I know the answer: The span API can
be implemented portably without modifying the underlying string representation.
But so can substring/shared since a valid implementation is string-copy.

I see the use-case for this API: As a portable library with guaranteed
sharing, not requiring changing the string implementation.  But I really don't
want to encourage people to program in this API.  As a language designer and
implementor, I'd rather change the underlying string representation in my
implementation, and tell people to use substring/shared.  That makes for a
much simpler and elegant language.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports