[Top][All Lists]

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

Re: Guile Binary Format 0.1

From: Matthew R Wette
Subject: Re: Guile Binary Format 0.1
Date: Wed, 21 Feb 2001 19:44:55 -0800

Dirk Herrmann writes ...
> Hello folks,
> with the current implementation of writing objects in a binary manner, we
> can not solve the following problem:
> (define foo (cons 'a 'b))
> (define bar (cons 'c foo))
> (define baz (cons 'd foo))
> (eq? (cdr bar) (cdr baz))
>   ==> #t
> (binary-write bar some-port)
> (binary-write baz some-port)
> ... and later:
> (define newbar (binary-read previously-written-data))
> (define newbaz (binary-read previously-written-data))
> (eq? (cdr newbar) (cdr newbaz))
>   ==> #f

What if the binary port uses a hash table of previously written 
cells and one writes out the table and replaces references to
cons cells with references to entries in the hash table.  Then
when the file is read in the cells are generated only once.

I'm thinking about the way XDR works with pointers and 
linked lists, etc.


reply via email to

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