Thanks for the help!
Interestingly enough, the example that you gave serializes
without any problems (you can remove the "let" block, and
it still serializes).
The only example that I've been able to construct by
hand is this:
(serialize command-line-arguments)
which fails. It makes sense to me that you can't serialize
things like open file handles, network sockets, and the like.
Command-line parameters seem different, but I suppose I can
see how at some level some OS voodoo might be going on.
So I'm still not sure that I totally understand what's going
on. Sigh.
(Or better: I'm totally sure that I still don't understand. :) )
-- David
On Feb 4, 8:08 pm, Andreas Rottmann <[email protected]> wrote:
> David Wingate <[email protected]> writes:
> > Hello, all. I've recently ported my scheme application to Ikarus
> > (love it!) and have a question.
>
> > I'm interested in serializing a complex structure which consists of
> > all sorts of functions, lists, strings and numbers. I've defined
> > serialize and deserialize using the same code found in scheme/tests/
> > fasl.ss.
>
> > When I attempt to serialize my structure, it gives the following
> > error:
>
> >> (serialize foodata)
> > Unhandled exception
> > Condition components:
> > 1. &assertion
> > 2. &who: fasl-write
> > 3. &message: "Cannot write a non-thunk procedure; the one given has
> > free vars"
> > 4. &irritants: (2)
>
> > I imagine this is NOT an error in Ikarus, but rather an error in my
> > thinking.
>
> > Could someone help me understand what generates this sort of error?
> > For example, the FASL system is quite happy to serialize the
> > following:
>
> >> (serialize (lambda(x) x))
>
> > which also appears to have "free vars." So I'm not sure what that
> > means, or how to best fix it.
>
> No, this has no free vars, as 'x' is bound in the expression '(lambda
> (x) x)' (as there is a formal parameter, which it refers to). This
> example is hence entirely independent of its environment; the following
> is not:
>
> (let ((foo 42))
> (serialize (lambda (x) (+ x foo))))
>
> In the expression '(lambda (x) (+ x foo))', 'x' occurs bound, and 'foo'
> occurs free. See alsohttp://en.wikipedia.org/wiki/Bound_variable.
>
> > P.S. What does FASL stand for, anyway? :)
>
> I think it's "FASt Load" or something alike.
>
> Kind regards, Rotty
> --
> Andreas Rottmann | ro...@icq | 118634...@icq |
> [email protected]http://rotty.uttx.net | GnuPG
> Key:http://rotty.uttx.net/gpg.asc
> Fingerprint | C38A 39C5 16D7 B69F 33A3 6993 22C8 27F7 35A9 92E7
> v2sw7MYChw5pr5OFma7u7Lw2m5g/l7Di6e6t5BSb7en6g3/5HZa2Xs6MSr1/2p7 hackerkey.com
>
> Always be wary of the Software Engineer who carries a screwdriver.
> -- Robert Paul