2

I want to read some code from a file and give this to a macro as a form. Since I need the form unevaluated I cannot use "load-string".

Is there a possibility to get a form from a string?

e.g the string is "(3 4 +)" and I would like to convert it to prefix notation by a macro of mine. (That is not the real use case here but it is a simple example.)

I hope someone can help me.

1

1 Answer 1

3

You should look at read and read-string. As an example:

user=> (read-string "(3 4 +)")
(3 4 +)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.