Reputation: 4403
I upgraded the clojurescript version of a working application to 0.0-2030 and suddenly reader/read-string returns null, e.g:
(js/alert (str "reader returned [" (reader/read-string "{1 2}") "]"))
shows []. I compile with the cljsbuild plugin:
:cljsbuild {:builds [{:source-paths ["src/cljs/main"],
:compiler {:pretty-print true,
:output-to "resources/public/cljs/main.js",
:optimizations :whitespace}}
reeader is defined like this:
(:require
[cljs.reader :as reader]
What can I be doing wrong?
Upvotes: 4
Views: 3184
Reputation: 3061
I've tried to setup a single clojurescript project following the minimal instructions detailed here: http://swannodette.github.io/2013/10/27/the-essence-of-clojurescript/
This project also uses the same clojurescript version
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/clojurescript "0.0-2030"]]
And this is the code I used into:
(ns hello-world.core
(:require [cljs.reader :as reader]))
(js/alert (str "reader returned [" (reader/read-string "{1 2}") "]"))
And works fine!
Upvotes: 2