<div dir="ltr"><div>Hi Bil,</div><div><br></div><div>Indeed it works, but the output of :readable grows out of hand.</div><div>Here is a snippet. Imagine if there were way more definitions (and nested "sub-namespaces")<br></div><div><br></div><div>(define *lib* <br> (let ()<br> (curlet)))<br><br>(with-let *lib*<br>         (define (make-state)<br>         (let ((a '(1 2 3)))<br>         (curlet)))<br><br>         (define make-state-2<br>         (let ((+documentation+ "Makes some state with b"))<br>         (lambda ()<br>                (let ((b '(1 2 3)))<br>                 (curlet))))))<br><br>(define state ((*lib* 'make-state)))<br><br>(object->string state)<br>;; => (inlet 'a (1 2 3))<br>;; perfect, but not eval'able<br><br>(object->string state :readable)<br><br>;; =><br>;; (sublet (sublet (sublet (inlet :make-state (lambda () (let ((a '(1 2 3))) (curlet))) :make-state-2 (let ((+documentation+ \"Makes some state with b\")) (lambda () (let ((b '(1 2 3))) (curlet))))))) :a (list 1 2 3))</div><div><br></div><div>So the :readable version essentially gives me essentially the source of *lib*..<br></div><div>Also, I realize now that in my application the problem that I faced was the "format ~W.." output was trimmed because it was too long.</div><div><br></div><div>From one hand indeed it works as expected (creating a complete definition).<br></div><div>But on the other hand this is unusable for saving state. (imagine storing all of this in some database for example.. it's mostly noise)</div><div><br></div><div>For now actually my problem is solved, since I'm defining the state in the rootlet, but this thing bugs me.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 30 Jul 2020 at 02:19, <<a href="mailto:bil@ccrma.stanford.edu">bil@ccrma.stanford.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The previous example would have worked; I thought<br>
you were unhappy that it was not simple, but it is<br>
intended for s7's use. object->string with :readable<br>
and format with ~W are the built-in ways to serialize<br>
most s7 objects.<br>
<br>
(The complexity of the previous example came from s7's<br>
attempt to preserve the outlet chain, but the outer<br>
let refers back to the inner one -- a circular reference).<br>
<br>
</blockquote></div>