chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] newbie srfi-38 (shared structure) & records question


From: felix winkelmann
Subject: Re: [Chicken-users] newbie srfi-38 (shared structure) & records question
Date: Mon, 15 Dec 2008 09:16:22 +0100

On Thu, Dec 11, 2008 at 9:42 AM, Basile STARYNKEVITCH
<address@hidden> wrote:
> Hello All
>
> (My third batch of questions)
>
> I want to use srfi-38, that is read-with-shared-structure &
> write-with-shared-structure to persistently store & reload (at next program
> invocation) a complex state with shared values. I like very much that the
> persisted state is some textual file. The issue is then to store values
> which contain stuff which cannot be really stored, in particular closures
> (perhaps even continuation closures), mutex, threads, etc... My intuition
> would be that these could be slots in records which I do not write (nor
> re-read) at all. So the record writer would write nil for such slots, and at
> read time some postprocessing would be required to fill them appropriately.
> Specifically, I was thinking of persisting my "function-like" values as the
> name of a function, the closed values, ... (closed within my DSL, not only
> in the chicken sense, because there is no way of accessing Chicken closures
> contents.).
>
> First are structures provided in http://chicken.wiki.br/Unit data-structures
> (e.g. queues) correctly persisted using write-with-shared-structure &
> read-with-shared-structure ?

No, they print like "#<...>", i.e. are unreadable.

>
> Second are external representations http://chicken.wiki.br/Non-standard read
> syntax  #,(CONSTRUCTORNAME DATUM ...) compatible with
> write-with-shared-structure & read-with-shared-structure ?

The sharing only supports lists, I'm afraid, so this doesn't help you.

>
> Also, does write-with-shared-structure uses the writing routines set on
> records with  define-record-printer ?

No, currently not. I will look into that, as support for this shouldn't
be too hard to add.

Unfortunately I'm drowning in things that I ought to do - so don't hold
your breath.


cheers,
felix




reply via email to

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