Treatment of empty string Shiro Kawai (24 Feb 2020 20:20 UTC)
Re: Treatment of empty string John Cowan (24 Feb 2020 20:24 UTC)
Re: Treatment of empty string Shiro Kawai (24 Feb 2020 20:50 UTC)
Re: Treatment of empty string Per Bothner (24 Feb 2020 21:22 UTC)
Re: Treatment of empty string John Cowan (24 Feb 2020 21:38 UTC)
Re: Treatment of empty string Shiro Kawai (24 Feb 2020 22:00 UTC)
Re: Treatment of empty string Arthur A. Gleckler (05 Apr 2020 22:47 UTC)
Re: Treatment of empty string Per Bothner (05 Apr 2020 23:41 UTC)
Re: Treatment of empty string Shiro Kawai (05 Apr 2020 23:51 UTC)
Re: Treatment of empty string John Cowan (06 Apr 2020 19:54 UTC)
Re: Treatment of empty string Shiro Kawai (06 Apr 2020 20:11 UTC)
Re: Treatment of empty string Per Bothner (06 Apr 2020 21:01 UTC)
(missing)
Re: Treatment of empty string Per Bothner (06 Apr 2020 21:49 UTC)
Re: Treatment of empty string John Cowan (06 Apr 2020 23:47 UTC)

Re: Treatment of empty string Per Bothner 24 Feb 2020 21:22 UTC

On 2/24/20 12:50 PM, Shiro Kawai wrote:
> The thing is, length-changing mutation is diversion from the location-based mutation model--at least in srfi-118, string-append! and string-replace! can't be explained by mutating the value of the original string locations.  It can be explained by introducing an indirection (a string have a single location that points to a location of the storage), but then an empty string can have a location.

It depends what you mean by "empty string".
This may be easier to discuss in the context of srfi-140,
which explicitly discusses mutable vs immutable strings.

A mutable string is clearly a location (object).  If srfi-118 or srfi-140
is supported then the value of a mutable string can be empty, but it is
distinct from the empty string literals.

Immutable strings (including string literals) that have the same value
(same sequence of characters) may be eq?.  Mutable strings are all
distinct objects (not eq?).  A mutable string whose string-length is 0
is never eq? to "", but it is equal?.  According to my reading of r7rs,
no mutable string is eqv? to any other mutable string *or* any immutable
string, including "".
--
	--Per Bothner
xxxxxx@bothner.com   http://per.bothner.com/