[plt-scheme] "define-values: cannot change identifier" when using "deserialize"

From: Eric Hanchrow (offby1 at blarg.net)
Date: Mon Oct 15 19:59:25 EDT 2007

Unfortunately I haven't been able to find a conveniently-small recipe
that will reproduce this; but if you're willing to type a single 'svn'
command to check out the code, and then run two simple shell commands,
I think you can see the problem repro.

(I'm using v371.2, by the way.)

Anyway, here's the vague description: the first time my program runs,
it saves some data to a file via the "serialize" procedure in (lib
"serialize.ss"); then the next time it runs, it tries to read that
data back, but dies with this error message:

         define-values: cannot change identifier that is instantiated as a module constant: *process-start-time* in module: |,/home/erich/doodles/plt-scheme/irc/bot|

That particular variable -- *process-start-time* -- isn't involved in
the serializing, but it does happen to be the first variable defined
in the module in which the "define-serializable-struct" call lives
... if that means anything.

Anyway, here's the repro steps for the faithful:

        $ svn checkout -r66 http://rudybot.googlecode.com/svn/trunk/ rudybot
        $ cd rudybot
        $ ./dry-test.sh
(that command will spew a bunch of innocuous stuff)
        $ ./dry-test.sh

That should yield the error.
Good writing is an elaborate effort to seem spontaneous.
        -- Paul Graham

Posted on the users mailing list.