chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] string-append


From: John Cowan
Subject: Re: [Chicken-hackers] string-append
Date: Fri, 20 Mar 2009 11:21:20 -0400
User-agent: Mutt/1.5.13 (2006-08-11)

Alex Shinn scripsit:

> 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.

Indeed.  I'd favor aggressive merger of literals, as well as
aggressive folding of string-append.  I read the R5RS provision
as merely requiring that "foobar" doesn't share content with either
"foo" or "bar", which it doesn't if the fold is done at compile time.

-- 
John Cowan   address@hidden    http://ccil.org/~cowan
[R]eversing the apostolic precept to be all things to all men, I usually [before
Darwin] defended the tenability of the received doctrines, when I had to do
with the [evolution]ists; and stood up for the possibility of [evolution] among
the orthodox --thereby, no doubt, increasing an already current, but quite
undeserved, reputation for needless combativeness.  --T. H. Huxley




reply via email to

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