[r6rs-discuss] [ANN] scheme-reports.org

Shiro Kawai shiro at lava.net
Tue Aug 25 16:21:05 EDT 2009


Fixed-length mutable string is one of the historical residues
very hard to shake off.

The useful cases you provided can be summerized as using
fixed-length string as a buffer of characters.   I argue
that  it is the *only* case the fixed-length mutable strings
are useful.

But these days there is one more constraint, which severely
decreases chance of such use cases being applicable: The
internal string representation must match the external 
string representation.
If you need conversion, generally you can't assume the
resulting string length is also fixed length.

For embedded systems or special-purpose systems you may
be able to assume external world only uses ascii or ucs4.
In such cases it is totally fine to use strings as fixed-size
buffers.  But such cases are special.  Any code written
with that assumption can't be portable, so you may as well
use implementation-specific extension.

Some sort of "string builder" may be handy to have, but
we can abstract that under the ports.   That gives 
"small scheme" implementations more freedom of implementing
such buffers.

--shiro


From: Thomas Lord <lord at emf.net>
Subject: Re: [r6rs-discuss] [ANN] scheme-reports.org
Date: Tue, 25 Aug 2009 12:49:41 -0700

> On Tue, 2009-08-25 at 11:51 -0700, Per Bothner wrote:
> > A mutable string or character sequence can be useful, but only
> > if supports insert and delete - at the very least append.
> 
> I think that is not *quite* true as stated but it
> clearly points to a truth.
> 
> A mutable character sequence that supports insert and
> delete is certainly useful in more situations than
> a mutable character sequence that supports only 
> replacement.
> 
> If you wanted to tell me that small Scheme should
> support insert/delete on strings I don't, off the top
> of my head, have any objections.   On the other hand,
> I don't feel like making that argument myself because
> of vague concern for the implied burden on implementations.
> 
> 
> > A mutable fixed-size string has so few uses (I can't think of
> > any) that there is little point is providing it in a language.
> > The only use I can think of is to implement a variable-size
> > string!  If there are any real use cases, they can use a vector.
> 
> I offered two examples of use cases which I think point
> to a broad range of situations where fixed-length mutable
> strings are quite useful.   I'm not sure why you are overlooking
> that.
> 
> -t
> 
> 
> 
> _______________________________________________
> r6rs-discuss mailing list
> r6rs-discuss at lists.r6rs.org
> http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss



More information about the r6rs-discuss mailing list