The main purpose of *read-eval* is to allow the reader to evaluate the expression while reading, usually for something that does not have a letter designation. If *read-eval* true (by default), read and read-string will evaluate the expression following # =. You can see how this function is used when *print-dup* attached to the truth - this means that you want the values โโprinted so that their exact types are saved, in which case you will see that some values โโare printed by C # = designation. The default value for *print-dup* is false - for most cases, the standard Clojure notation is fine. For example, we usually do not care about the difference between integers and longs.
The *read-eval* function is useful for downloading code, but poses a security risk when used with untrusted input. It is generally recommended prior to Clojure 1.5 to bind *read-eval* false when dealing with user input. However, there are still some problems with reading Java objects that may cause problems. This is fixed in Clojure 1.5. More importantly, Clojure 1.5, clojure.edn/read and clojure.edn/read-string , which do not support any *read-eval* functions. They are safe to read user input representing normal Clojure values โโdefined in EDN format. See http://edn-format.org for more details.
miner49r
source share