[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/

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
> >
> >
> >  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))
 #;5> (eq? x y)
 #;6> (eq? y z)
 #;7> x
 #;8> y
 #;9> (eq? x 'test)
 #;10> (eq? x 'TEST)
 #;11> (eq? y 'TEST)
 #;12> (eq? y 'test)

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.


"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

Attachment: pgpxQqgjJLcfR.pgp
Description: PGP signature

reply via email to

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