I\'m trying to understand how to get the eval function to read a string and evaluate the content that\'s inside the string.
Currently I know that
> (
You want to use read together with open-input-string. Like so:
read
open-input-string
-> (eval (read (open-input-string "(+ 1 2)"))) 3
You can also use with-input-from-string:
with-input-from-string
-> (with-input-from-string "(+ 1 2)" (lambda () (eval (read)))) 3