4

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?

1 Answer 1

2

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!

Sign up to request clarification or add additional context in comments.

4 Comments

Sure. I work on this project for months and this part always worked fine. Until today, when I upgraded. So I wonder what can have gone wrong. I am not going to setup a new project, I have the fix the one I already have.
@Assen, have you tried doing lein cljsbuild clean? You may have old compiled files laying around.
@jbm, thanks, thanks a lot, as embarrassed I am that I didn't try this before posting. Issue solved.
my response is related to demonstrate that the clojurescript version and reader function works, then you have to try lein clean and lein cljs build clean as @Assen says and I was going to propose

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.