Docs: add an example of evaluating a string
This commit is contained in:
parent
dda456ddd9
commit
2dd1432b07
@ -812,6 +812,15 @@ defaults to the name of the current module.
|
|||||||
=> (eval '(print "Hello World"))
|
=> (eval '(print "Hello World"))
|
||||||
"Hello World"
|
"Hello World"
|
||||||
|
|
||||||
|
If you want to evaluate a string, use ``read-str`` to convert it to a
|
||||||
|
form first:
|
||||||
|
|
||||||
|
.. code-block:: clj
|
||||||
|
|
||||||
|
=> (eval (read-str "(+ 1 1)"))
|
||||||
|
2
|
||||||
|
|
||||||
|
|
||||||
eval-and-compile
|
eval-and-compile
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user