以下程序在 Clojure 中按预期工作,但在 ClojureScript 中引发错误。我想知道这是一个错误还是 ClojureScript 中根本没有该功能,或者我是否需要重新考虑我尝试这样做的方式。非常感谢您提前提供的帮助。
; Clojure...
(defn foo [x] x)
(defn foobee [x] (str (foo x) "bee"))
(println
((resolve (symbol (str "foo" "bee"))) "bizzee"))
;=> bizzeebee
; ClojureScript...
(defn foo [x] x)
(defn foobee [x] (str (foo x) "bee"))
(.log js/console
((resolve (symbol (str "foo" "bee"))) "bizzee"))
;=> Exception in thread "main" java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol