chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] string-append


From: Alex Shinn
Subject: Re: [Chicken-hackers] string-append
Date: Fri, 20 Mar 2009 12:23:49 +0900
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (darwin)

felix winkelmann <address@hidden> writes:

> On Thu, Mar 19, 2009 at 4:53 AM, Jim Ursetto <address@hidden> wrote:
>
>> I also noticed identical literal strings are not coalesced in the
>> compiler.  I was interested to know if this is done to ensure these
>> strings are separate mutable copies, or if it was just not worth the
>> effort to coalesce them.
>
> The former, as mutating them may cause headaches if the literal
> is used in different places.

Sure, but according to R5RS "it is an error" to mutate a
literal constant, which means it's the programmer's fault.

So the question is, assuming the programmer is writing bad
code, how best to handle it?  Trying to accommodate the bad
code may satisfy some users, but may just delay or obscure
the source of bugs for other users.  It also encourages
writing non-portable code that relies on literal mutation.

-- 
Alex




reply via email to

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