Resolve function throws an error in ClojureScript but not Clojure

后端 未结 1 1989
别那么骄傲
别那么骄傲 2021-01-11 14:18

The following program works as I expected in Clojure, but throws an error in ClojureScript. I\'m wondering if this is a bug or the feature simply isn\'t available in Clojure

相关标签:
1条回答
  • 2021-01-11 15:02

    resolve doesn't exist in ClojureScript. In fact, ClojureScript does not have Vars.

    Calling a function whose name is constructed dynamically is possible through various hacks (like using aget with the namespace object), which are however guaranteed to break with advanced compilation unless all the relevant symbols are exported. Also, currently none enjoy official support even with the more permissive compilation settings.

    0 讨论(0)
提交回复
热议问题