Re: SRFI 130 - "span" prefix
taylanbayirli@xxxxxx 04 Dec 2015 16:50 UTC
Per Bothner <xxxxxx@bothner.com> writes:
> On 12/04/2015 07:53 AM, John Cowan wrote:
>
>> But "string" already means something in Scheme: a *mutable* sequence
>> of characters addressable by indexes (such that adding 1 to the index
>> gets the next character and subtracting 1 gets the previous character
>> modulo boundary cases).
>
> Not in R7RS: "Strings are sequences of characters."
> String may be immutable or mutable. So we already have two kinds
> of strings.
Make-string and string seem to be specified to return mutable strings.
(The "newly allocated" part makes that clear I think.)
(Constants in source code are an exception as usual, and some strings
returned by certain APIs. But there's no direct way to create immutable
strings dynamically.)
That being said, I'm with R6RS on that we should move towards immutable
pairs and strings by default, not have new types for their immutable
variants. In that vein, I wouldn't mind an SRFI defining ways to get
immutable strings that still work with the usual non-mutating string
operations. Whether SRFI 130 or another...
Taylan