Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use clojure.string/join in clojurescript

I have the following function:

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

But I always got an error:

Uncaught ReferenceError: clojure is not defined 
like image 671
Andreas Köberle Avatar asked May 19 '14 21:05

Andreas Köberle


1 Answers

You need to include the module in the namespace form:

(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

If you have trouble, try cleaning and restarting the compiler (lein do cljsbuild clean, cljsbuild auto)

like image 132
Joaquin Avatar answered Sep 28 '22 04:09

Joaquin