Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top