问题 如何在clojurescript中使用clojure.string / join


我有以下功能:

(defn join [a] (clojure.string/join  " " a))

但我总是得到一个错误:

Uncaught ReferenceError: clojure is not defined 

3976
2018-05-19 21:11


起源



答案:


您需要在命名空间表单中包含该模块:

(ns my-app.core
  (:require [clojure.string :as string]))

(clojure.string/blank? "")

(string/blank? "")

https://github.com/swannodette/lt-cljs-tutorial/blob/master/lt-cljs-tutorial.cljs#L22-L33

如果遇到问题,请尝试清理并重新启动编译器(lein do cljsbuild clean, cljsbuild auto


15
2018-05-20 15:32