Вопрос

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?

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top