문제

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