Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
(load-string s)そのドキュメントによると:
「文字列に含まれるフォームのセットを順番に読み取って評価します」
次のコードで機能しないのはなぜですか?
(let [fun #(+ 1 2)] (load-string "(fun)"))
ご協力ありがとうございました!
load-stringから字句環境にアクセスすることはまったくできないため、これでも機能しません。
(let [fun 12] (load-string "(+ 1 fun)"))
バインドされた値のみが機能します。ここを参照してください。
clojureを使用した動的コード