Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

Using QuickStart, set up Node REPL.

Manually add a {{foo/bar.cljs}} to filesystem with

`
(ns foo.bar)

(defn throw-ex [] (ffirst 1))

(defn call-me [] (throw-ex))
`

Check that it works:

`
cljs.user=> (require 'foo.bar)
nil
cljs.user=> (foo.bar/call-me)
repl:13
throw e4210auto__;

  ^

Error: 1 is not ISeqable

at Object.cljs$core$seq [as seq] (/Users/mfikes/Desktop/hello_world-node/out/cljs/core.cljs:956:20)
at Object.cljs$core$first [as first] (/Users/mfikes/Desktop/hello_world-node/out/cljs/core.cljs:965:16)
at cljs$core$ffirst (/Users/mfikes/Desktop/hello_world-node/out/cljs/core.cljs:1398:11)
at foo$bar$throw_ex (/Users/mfikes/Desktop/hello_world-node/out/foo/bar.cljs:3:20)
at foo$bar$call_me (/Users/mfikes/Desktop/hello_world-node/out/foo/bar.cljs:5:19)
at repl:1:105
at repl:9:3
at repl:14:4
at Object.exports.runInThisContext (vm.js:74:17)
at Domain.<anonymous> ([stdin]:41:34)

`

Then manually move {{bar.cljs}} to {{bar.cljc}} and add a new symbol so it looks like:

`
(ns foo.bar)

(defn throw-ex [] (ffirst 1))

(defn call-me [] (throw-ex))

(defn call-again [] (call-me))
`

Then reload the ns and use the new symbol:

`
cljs.user=> (require 'foo.bar :reload)
nil
cljs.user=> (foo.bar/call-again)
repl:13
throw e4210auto__;

  ^

Error: 1 is not ISeqable

at Object.cljs$core$seq [as seq] (/Users/mfikes/Desktop/hello_world-node/out/cljs/core.cljs:956:20)
at Object.cljs$core$first [as first] (/Users/mfikes/Desktop/hello_world-node/out/cljs/core.cljs:965:16)
at cljs$core$ffirst (/Users/mfikes/Desktop/hello_world-node/out/cljs/core.cljs:1398:11)
at foo$bar$throw_ex (/Users/mfikes/Desktop/hello_world-node/out/foo/bar.cljs:3:20)
at foo$bar$call_me (/Users/mfikes/Desktop/hello_world-node/out/foo/bar.cljs:5:19)
at foo$bar$call_again (/Users/mfikes/Desktop/hello_world-node/out/foo/bar.cljs:5:19)
at repl:1:108
at repl:9:3
at repl:14:4
at Object.exports.runInThisContext (vm.js:74:17)

`

This illustrates the defect. {{call_again}} and the other symbols are shown as being in the old filename.

Stop the REPL and restart it to see correct behavior:

`
cljs.user=> :cljs/quit
orion:hello_world-node mfikes$ rlwrap java -cp cljs.jar:src clojure.main node_repl.clj
Reading analysis cache for jar:file:/Users/mfikes/Desktop/hello_world-node/cljs.jar!/cljs/core.cljs
Compiling src/foo/bar.cljc
ClojureScript Node.js REPL server listening on 49397
Watch compilation log available at: out/watch.log
To quit, type: :cljs/quit
cljs.user=> (require 'foo.bar)
nil
cljs.user=> (foo.bar/call-again)
repl:13
throw e4210auto__;

  ^

Error: 1 is not ISeqable

at Object.cljs$core$seq [as seq] (/Users/mfikes/Desktop/hello_world-node/out/cljs/core.cljs:956:20)
at Object.cljs$core$first [as first] (/Users/mfikes/Desktop/hello_world-node/out/cljs/core.cljs:965:16)
at cljs$core$ffirst (/Users/mfikes/Desktop/hello_world-node/out/cljs/core.cljs:1398:11)
at foo$bar$throw_ex (/Users/mfikes/Desktop/hello_world-node/out/foo/bar.cljc:3:20)
at foo$bar$call_me (/Users/mfikes/Desktop/hello_world-node/out/foo/bar.cljc:5:19)
at foo$bar$call_again (/Users/mfikes/Desktop/hello_world-node/out/foo/bar.cljc:7:22)
at repl:1:108
at repl:9:3
at repl:14:4
at Object.exports.runInThisContext (vm.js:74:17)

`

2 Answers

0 votes
by

Comment made by: mfikes

FWIW as a comparison, the same use case works properly with Clojure 1.7.0-beta2.

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-1266 (reported by mfikes)
...