chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Broken `utf8#string-fill!`?


From: John Cowan
Subject: Re: [Chicken-users] Broken `utf8#string-fill!`?
Date: Thu, 12 Jul 2018 20:09:32 -0400

On Thu, Jul 12, 2018 at 6:10 PM, John Cowan <address@hidden> wrote:
You can't fill a literal string; you have to treat it as immutable.
 
Actually it's not about mutability.  There is a documented restriction ("Attempting to mutate literal strings will result in an error if the mutated size does not occupy the same number of bytes as the original. This is standards compliant, since the programmer is not supposed to attempt to mutate literal values, but it may be a little confusing since the error is inconsistent.").  But that is not the issue here, since both #\j and #\Space are single-byte characters, and in fact (string-fill! (string #\j #\j) #\space) fails in the same way with the utf8 egg but works without the egg.  So it's a bug, but I would recommend that you avoid mutating strings altogether.



reply via email to

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