[plt-scheme] Reading structs from a file

From: Noel Welsh (noelwelsh at gmail.com)
Date: Tue Mar 23 06:33:05 EDT 2010

What is the content of posn.txt?

The problem is almost certainly due to generative structures. I
suggest reading Section 5 of the Guide, which deals extensively with
this.

HTH,
N.

On Tue, Mar 23, 2010 at 10:06 AM, wooks . <wookiz at hotmail.com> wrote:
>
> Tried to read a posn that I had written to a file
>
> with
>
> (with-input-from-file "posn.txt" (lambda () (posn-x (read))))
>
> Got posn-x: expects argument of type <struct:posn>; given #(struct:posn 3 4)
>
> Btw I thought with-input-from-file was supposed to be part of ASL?
>
> PS I can read lists from file no problem.


Posted on the users mailing list.