Question

I'm reading lines from a data file that are in list form. An example line is: ((P X1 (f X1)) (P Y (f b)))

Using read-line gives me a string which would require some tricky work to return to its original list form. I would like to avoid this work if possible.

Is there a simple way to read a line from a file as a list instead of as a string?

Was it helpful?

Solution

If you already have a string, you can get the list out of it using read-from-string.

However, you can get the list right out of the input stream using read.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top