Email list hosting service & mailing list manager

istring? Marc Nieper-Wißkirchen (15 Jul 2016 12:36 UTC)
Re: istring? Per Bothner (15 Jul 2016 14:25 UTC)
Re: istring? John Cowan (15 Jul 2016 15:53 UTC)
Re: istring? John Cowan (15 Jul 2016 14:59 UTC)
Re: istring? Per Bothner (15 Jul 2016 15:47 UTC)
Re: istring? John Cowan (15 Jul 2016 16:18 UTC)
Re: istring? Marc Nieper-Wißkirchen (16 Jul 2016 13:19 UTC)
Re: istring? John Cowan (16 Jul 2016 15:14 UTC)

Re: istring? John Cowan 15 Jul 2016 14:59 UTC

Marc Nieper-Wißkirchen scripsit:

> As an analogue, consider `#(1 2)' and `(vector 1 2)'. The literal is
> immutable, the vector returned by the procedure application is
> mutable. However, there is no predicate distinguishing between the
> two cases.

That's because implementations are not required to make a distinction
between the two, and some do not.  Chicken and Chibi, for example, have
only mutable versions of either strings or vectors.  *Users* must make
the distinction in portable code, but that's a different matter.

As far as I can tell, implementations like Chibi, where the internal
representation is UTF-8 and no mutable/immutable distinction is
made, can't implement SRFI 140 without changing that, because SRFI
140 guarantees that string operations on literal strings are O(1).
That seems to me to be a high barrier to the adoption of SRFI 140,
and the chief reason why SRFI 140 is not just a blanket rename of
SRFI 135.

--
John Cowan          http://www.ccil.org/~cowan        xxxxxx@ccil.org
MEET US AT POINT ORANGE AT MIDNIGHT BRING YOUR DUCK OR PREPARE TO FACE WUGGUMS