How to execute string?

How to execute string?

Anonymous
Not applicable
993 Views
1 Reply
Message 1 of 2

How to execute string?

Anonymous
Not applicable

I have some string with lisp code

(setq str "(+ 2 3 4 5)")

>str
>"(+ 2 3 4 5)"

Or I have that

(setq code '(+ 2 3 4 5 6))

>code
(+ 2 3 4 5 6)
>(type code)
LIST
>(code)
>wrong function : (+ 2 3 4 5 6)

 

So, how I can execute lisp code from variable?

0 Likes
Accepted solutions (1)
994 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

I solve problem.

 

Function eval!

 

(eval code)
0 Likes