David Williams
David Williams

Reputation: 8664

Clojure String to Form

I would like to convert a string to a form in clojure. Something like

(defn string-to-form [string]
   ;; some magic here
   converted-to-form)

This question has the opposite direction, namely form to string. How to I go the other way?

Upvotes: 0

Views: 94

Answers (1)

piyushmandovra
piyushmandovra

Reputation: 4381

hey if i am correct your want to know

"(+ 1 2)" ;=> (+ 1 2)

if these is you problem then you can use read-string from clojure.core

(defn string-to-form [string] (read-string string))

Upvotes: 1

Related Questions