chicken-janitors
[Top][All Lists]
Advanced

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

Re: [Chicken-janitors] #768: s11n: reconstruction of hash-tables incorre


From: Chicken Trac
Subject: Re: [Chicken-janitors] #768: s11n: reconstruction of hash-tables incorrect on de-serialization
Date: Mon, 14 Jan 2019 19:39:18 -0000

#768: s11n: reconstruction of hash-tables incorrect on de-serialization
-----------------------------------+-------------------
            Reporter:  felix       |      Owner:
                Type:  defect      |     Status:  new
            Priority:  critical    |  Milestone:
           Component:  extensions  |    Version:  4.7.x
          Resolution:              |   Keywords:  s11n
Estimated difficulty:  hard        |
-----------------------------------+-------------------

Comment (by mario):

 Here's a simple example to illustrate the problem:

 {{{
 $ cat s11n-ht.scm
 (use srfi-69)
 (use s11n)

 (define ht1
   (alist->hash-table '((foo . bar))))

 (define ht2
   (alist->hash-table `((foo . bar)
                        (ht . ,ht1))))

 (with-output-to-file "serialized.s11n"
   (lambda ()
     (serialize ht2)))

 (pp (hash-table->alist
      (with-input-from-file "serialized.s11n" deserialize)))
 }}}

 {{{
 $ csi -s s11n-ht.scm
 ((foo . bar) (ht . #<hash-table (1)>))

 $ csi -s s11n-ht.scm
 ((ht . #<hash-table (1)>))

 $ csi -s s11n-ht.scm
 ((ht . #<hash-table (1)>) (foo . bar))

 $ csi -s s11n-ht.scm
 ((foo . bar) (ht . #<hash-table (1)>))

 $ csi -s s11n-ht.scm
 ((ht . #<hash-table (1)>) (foo . bar))

 $ csi -s s11n-ht.scm
 ((ht . #<hash-table (1)>) (foo . bar))

 $ csi -s s11n-ht.scm
 ((ht . #<hash-table (1)>) (foo . bar))

 $ csi -s s11n-ht.scm
 ((ht . #<hash-table (1)>))

 $ csi -s s11n-ht.scm
 ((ht . #<hash-table (1)>))

 $ csi -s s11n-ht.scm
 ((foo . bar) (ht . #<hash-table (1)>))
 }}}

 Maybe I was not creative enough, but I could only reproduce this behavior
 with nested hash-tables.

--
Ticket URL: <https://bugs.call-cc.org/ticket/768#comment:2>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

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