[CM] (sub)environments and object->string with :readable

Christos Vagias chris.actondev at gmail.com
Wed Jul 29 16:22:02 PDT 2020


Hi Bil,
thanks for the quick response.

The problem that I'm facing is that write/ format ~S doesn't wrap lists
around (list ..),
thus I cannot use for serialize/deserialize. (my objective is saving/loading
state)

And the example I gave about the namespace is really simple.
In my situation I'm doing things like loading a whole file into a separate
namespace
Like this example from the documentation

(define *lib*
   (let ()
       (with-let (unlet)
(load "any-library.scm" (curlet))
;; etc..
)))

How could I "write" something that comes from *lib* that is eval'able like
the object->string :readable does?
(Practically, picture that there is "make-state" function in *lib* that
returns a curlet, like we were discussing in the previous email,
and you need to serialize/deserialize this state object)

I realize that I might be pushing the language limits like this, but I hope
there is a solution.

On Wed, 29 Jul 2020 at 22:28, <bil at ccrma.stanford.edu> wrote:

> "readable" in this context means readable by s7.  So, yes, that's about
> what I'd
> expect.  You can do this more simply:
>
> (define *subnamespace* (inlet :nested-curlet (inlet :nested 1)))
>
> and to print it:
>
> (display (*subnamespace* :nested-curlet))
>
> which gives:
>
> (inlet 'nested 1)
>
> and similarly with (format #f "~S" (*sub...))
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20200730/231855ee/attachment-0001.html>


More information about the Cmdist mailing list