Re: [Scheme-reports] fresh empty strings Ray Dillinger (24 Jan 2012 16:53 UTC)
Re: [Scheme-reports] fresh empty strings John Cowan (24 Jan 2012 19:05 UTC)
Re: [Scheme-reports] fresh empty strings Per Bothner (24 Jan 2012 19:25 UTC)
Re: [Scheme-reports] fresh empty strings John Cowan (24 Jan 2012 20:26 UTC)
Re: [Scheme-reports] fresh empty strings Per Bothner (24 Jan 2012 20:46 UTC)
Re: [Scheme-reports] fresh empty strings John Cowan (24 Jan 2012 21:20 UTC)
Re: [Scheme-reports] fresh empty strings Alex Shinn (25 Jan 2012 00:26 UTC)
Re: [Scheme-reports] fresh empty strings Per Bothner (25 Jan 2012 01:09 UTC)
Re: [Scheme-reports] fresh empty strings Alex Shinn (25 Jan 2012 02:08 UTC)
Re: [Scheme-reports] fresh empty strings John Cowan (25 Jan 2012 02:31 UTC)
Re: [Scheme-reports] fresh empty strings Alex Shinn (25 Jan 2012 02:35 UTC)
Re: [Scheme-reports] fresh empty strings John Cowan (25 Jan 2012 02:44 UTC)
Re: [Scheme-reports] fresh empty strings Alex Shinn (25 Jan 2012 03:26 UTC)
Re: [Scheme-reports] fresh empty strings Per Bothner (25 Jan 2012 03:43 UTC)
Re: [Scheme-reports] fresh empty strings Alex Shinn (25 Jan 2012 12:58 UTC)
Re: [Scheme-reports] fresh empty strings Per Bothner (25 Jan 2012 19:59 UTC)
Re: [Scheme-reports] fresh empty strings Alex Shinn (25 Jan 2012 23:49 UTC)
Re: [Scheme-reports] fresh empty strings John Cowan (25 Jan 2012 21:00 UTC)
Re: [Scheme-reports] fresh empty strings Ray Dillinger (25 Jan 2012 18:57 UTC)
Re: [Scheme-reports] fresh empty strings John Cowan (25 Jan 2012 01:38 UTC)

Re: [Scheme-reports] fresh empty strings John Cowan 24 Jan 2012 21:19 UTC

Per Bothner scripsit:

>> I am far from convinced of that.  I think the arguments for providing
>> mutable strings only
>
> I assume s/mutable/immutable/ above.

Oops, yes.

> I agree this is (at least) premature for R7RS-small.  I might
> experiment with it in Kawa and if so write up a SRFI.

Please do, or else as an R7RS-large package (send it to me and I'll post
it).

>> Emacs buffers is the obvious prior art.
>
> I mean a Scheme API.  Emacs buffers are much more heavy-weight than
> strings.

Indeed.  However, my experience is that it's easier to start with a
heavyweight but complete API and cut it back by removing things that
aren't essential.

> Even better prior art would be a Scheme (or at least Lisp-family)
> dialect where mutable strings are variable-length.  (Common Lisp
> allows adjustable arrays and thus adjustable strings, but it doesn't
> have the kind of API I'm talking about, nor is buffer-gap normally
> used.)

Common Lisp, and following it MIT Scheme, have fill pointers.  In MIT
Scheme it is always provided when a string is allocated, so you can
effectively shrink a string from its initial size, but not grow it.  The
MIT interface is just string-maximum-length and set-string-length!.  It
isn't defined whether the contents of a string past the current length
are preserved, but simple tests suggest that they are.  Unlike CL,
characters beyond the current length are fully inaccessible.

--
John Cowan           http://www.ccil.org/~cowan            cowan@ccil.org
One of the oil men in heaven started a rumor of a gusher down in hell.  All
the other oil men left in a hurry for hell.  As he gets to thinking about
the rumor he had started he says to himself there might be something in
it after all.  So he leaves for hell in a hurry.    --Carl Sandburg

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