Re: Wrapping a string as-is

2017-01-01 Thread Steve Miner
Use clojure.edn/read-string. Note the clojure.edn namespace. clojure.core/read-string can execute code (controlled by *read-eval*), and as such should be used only with trusted sources. > On Jan 1, 2017, at 10:07 AM, Yehonathan Sharvit wrote: > > I’d like to write a function `foo` that recei

Wrapping a string as-is

2017-01-01 Thread Yehonathan Sharvit
I’d like to write a function `foo` that receives a string `s` and returns a list with the value of `s` without the quotes as a single element. A possible implementation, I wrote: ``` (defn foo [s] (list (symbol s))) (def my-string "[1 2]") (foo my-string) ; ([1 2]) ``` But it feels weird to me to