Re: External representation taylanbayirli@xxxxxx 11 Sep 2015 21:48 UTC

Kevin Wortman <xxxxxx@gmail.com> writes:

> R7RS-small defines alists, which are a longstanding data structure for
> key-value associations that has a reader syntax. I think that's why
> converting between hash tables and alists is important. (IIRC, that
> came up on another thread.) With those conversion routines you can
> convert a hashtable to an alist then write the alist, and vice-versa.
>
> Kevin Wortman

Right.  Sadly that doesn't encode any information about the hashtable's
hash and equivalence function.  Doing it manually is a chore.  This
external representation covers the most common cases, with possible
extensions in the future.

If we also had a good external representation for record types, that
would make 'read' and 'write-shared' incredibly powerful, even more so
than they already are.  You could output whole object graphs including
not only lists and vectors, but also record types and hashtables.  That
leaves out procedures, which is really unfortunate, but at least it
would only leave that.  (I assume the eof-object and ports are useless
to serialize.)

Taylan