Clojure 字符串形成

Clojure String to Form

我想将字符串转换为 clojure 中的表单。像

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

This question方向相反,即form to string。我怎么走另一条路?

嘿,如果我是正确的,你想知道

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

如果这些是你的问题,那么你可以使用 clojure.core

中的读取字符串
(defn string-to-form [string] (read-string string))