You're viewing version 1.2.0 of *read-eval*. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16

*read-eval*

clojure.core

When set to logical false, the EvalReader (#=(...)) is disabled in the
read/load in the thread-local binding.
Example: (binding [*read-eval* false] (read-string "#=(eval (def x 3))"))

Defaults to true

1 Example top

  • ;;just from the doc
    
    (binding [*read-eval* false] (read-string "#=(eval (def x 3))"))
    => EvalReader not allowed when *read-eval* is false.
      [Thrown class java.lang.RuntimeException]
    
    ;;remove the anonymous function:
    
    (binding [*read-eval* false] (read-string "(def x 3)"))
    => (def x 3)
    
    ;;which is evaluable
    
    (eval (binding [*read-eval* false] (read-string "(def x 3)")))
    => #'user/x
    
    x
    =>3
Log in to add / edit an example.

See Also top

Log in to add a see also.

Comments top

No comments for *read-eval*. Log in to add a comment.