Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to parse a string as a list structure?

I have a string, which holds a a list structure like ((p X) (q (f X))) and I would really like to find a function that interprets/converts this string as a list of lists just like if it was a '((p X) (q (f X))).

(list "((p X) (q (f X)))") just makes it a single element list.

(intern "((p X) (q (f X)))") encloses it in | symbols.

like image 568
user1048677 Avatar asked Feb 23 '26 23:02

user1048677


1 Answers

How does

(read-from-string  "((p X) (q (f X)))")

work for you? Documentation found here.

like image 162
Trey Jackson Avatar answered Feb 27 '26 04:02

Trey Jackson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!