[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] Symbols and immutability
From: |
Peter Bex |
Subject: |
Re: [Chicken-hackers] Symbols and immutability |
Date: |
Mon, 14 Apr 2008 10:38:12 +0200 |
User-agent: |
Mutt/1.4.2.3i |
On Mon, Apr 14, 2008 at 10:21:40AM +0200, felix winkelmann wrote:
> On Sun, Apr 13, 2008 at 3:43 PM, Peter Bex <address@hidden> wrote:
> > Hi all,
> >
> > According to Elf the main Chicken hackers (Felix and Kon) do not
> > read the janitors list and few others do.
> >
> > I just submitted a ticket for a nasty bug, #433
> > http://trac.callcc.org/ticket/433
> >
> > What are your thoughts on how to solve this issue?
> >
>
> Sorry, I don't use trac anymore, as I seldom get any kind
> of connection to it.
I thought there were plans to move trac to galinha because of these
problems. Mario, Arto, anyone: Will/can this be done soon?
The current situation really is unusable.
> Can you describe the problem here?
Here's a paste of my ticket's text:
---
When using ->string on a symbol and calling a destructive string
procedure on the result, you mutate the original symbol everywhere it's
used. After that, the mutated symbol is not eq? to the same symbol
when made afresh.
#;1> (define x 'TEST)
#;2> (define y 'test)
#;3> (define z 'test)
#;4> (string-upcase! (->string y))
"TEST"
#;5> (eq? x y)
#f
#;6> (eq? y z)
#t
#;7> x
TEST
#;8> y
TEST
#;9> (eq? x 'test)
#f
#;10> (eq? x 'TEST)
#t
#;11> (eq? y 'TEST)
#f
#;12> (eq? y 'test)
#f
Not sure what the solution should be. Perhaps ->string should just
make a copy, or the destructive procedures should make a copy when invoked
on an immutable string, or refuse to operate on immutable strings.
---
Cheers,
Peter
--
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
is especially attractive, not only because it can be economically
and scientifically rewarding, but also because it can be an aesthetic
experience much like composing poetry or music."
-- Donald Knuth
pgpxQqgjJLcfR.pgp
Description: PGP signature