chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] s11n among different chicken versions


From: Daishi Kato
Subject: Re: [Chicken-users] s11n among different chicken versions
Date: Mon, 7 Aug 2006 16:30:50 +0900

On 8/7/06, felix winkelmann <address@hidden> wrote:
On 8/3/06, Daishi Kato <address@hidden> wrote:
> Now, I can reproduce the problem.
>
> % cat dump.scm
> (use s11n)
> (define x (make-hash-table))
> (hash-table-set! x 'aaa (make-hash-table))
> (hash-table-set! x 'bbb (make-hash-table))
> (with-output-to-file "dump"
>   (lambda ()
>     (serialize x)))
> % cat undump.scm
> (use s11n)
> (define (deserialize-fallback id)
>   (cond ((string=? id "f_3497library.scm") ; chicken-2.315
>          equal?)
>         ((string=? id "f_6914extras.scm") ; chicken-2.315
>          hash)
>         (else
>          (error "deserialize-fallback unknown id" id))))
> (with-input-from-file "dump"
>   (lambda ()
>     (deserialize (current-input-port) deserialize-fallback)))
> % /usr/local/chicken-2.315/bin/csi -q -s dump.scm
> % /usr/local/chicken-2.41/bin/csi -q -s undump.scm
> Error: (for-each) argument is not a proper list: ((aaa .
> #<hash-table>) . #<procedure (hash x1094 . g10931095)>)
>
>         Call history:
>
>         <eval>          (##sys#require (quote s11n))
>         <eval>          (with-input-from-file "dump" (lambda ()
> (deserialize (current-input-port) deserialize-fallback)))
>         <eval>          (deserialize (current-input-port) 
deserialize-fallback)
>         <eval>          (current-input-port)
>         <eval>          [deserialize-fallback] (string=? id 
"f_3497library.scm")
>         <eval>          [deserialize-fallback] (string=? id 
"f_3497library.scm")
>         <eval>          [deserialize-fallback] (string=? id
> "f_6914extras.scm")<--

I can't say much about this problem. As I already said, the procedure-IDs
might be re-used, so this approach is definitely not safe.

If the procedure ID is really re-used, the fallback procedure is never
called, isn't it?

If I could not find any solution to this, my final resort would be
editting the binary dump file to change procedure IDs.

Daishi




reply via email to

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