guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guile BUG: What's wrong with this?


From: Bruce Korb
Subject: Re: Guile BUG: What's wrong with this?
Date: Sat, 07 Jan 2012 07:27:51 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111220 Thunderbird/9.0

On 01/07/12 07:00, Mark H Weaver wrote:
I think you are presuming that that is the only source of zero length
immutable strings.  Are you completely certain?

Empty string literals ("") in the program text are still immutable, so
(string-upcase! "") still throws an error.

I admit that this is an arguable point.  Section 3.4 (Storage model) of
the R5RS (and the R7RS draft) says "It is an error to attempt to store a
new value into a location that is denoted by an immutable object."  An
empty string denotes no locations, so perhaps this should not be an
error after all.

The right place to fix this would probably be in
`scm_i_string_start_writing' (strings.c).

What do other people think?

I think it too much effort for that function.  I looked at it.
The problem is that you'd have to pass it the start and end points,
that is, change its interface.  Not worth it.  Either do as you've
done and have a shared writable zero length string, or exit the
functions that use scm_i_string_start_writing before calling that
function, in the event that these string transformation functions
detect a zero length string (my patch).  Either way.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]