chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] symbol->string


From: felix winkelmann
Subject: Re: [Chicken-users] symbol->string
Date: Mon, 23 Oct 2006 14:26:55 +0200

On 10/23/06, address@hidden
<address@hidden> wrote:
Hello Thomas.

> If you want alphabetic ordering, you should avoid symbol->string, because
> it copies the name of the symbol to a new string -- this is necessary as
> Scheme's strings are mutable objects!

With some exceptions, like ... symbol->string :-)
"It is an error to apply mutation procedures like string-set! to
strings returned by this procedure."
from
<www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-9.html#%_sec_6.3.3>


That it is an error does not prevent someone from creating havoc by
mutating interned symbol names. Therefore it is safer and standard
compliant to copy the string.


cheers,
felix


--
http://galinha.ucpel.tche.br:8081/blog/blog.ssp




reply via email to

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