<< Back to previous view

[CLJS-479] load-file in REPL improperly qualifies current-namespace ::keywords Created: 28/Feb/13  Updated: 22/Oct/13  Resolved: 22/Oct/13

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Chas Emerick Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: File CLJS-479.diff    
Patch: Code


This can be seen by opening a REPL and:

(load-file "cljs/ns_test/foo.cljs")

The ::foo keyword in that file is resolved improperly:

ClojureScript:cljs.user> cljs.ns-test.foo/kw

cljs.repl/load-stream needs to force *ns* to track *cljs-ns* so that the Clojure reader will properly resolve auto-namespacing keywords. A patch is attached that does this, ensuring that any Clojure namespaces created solely for this purpose are removed.

Comment by Chas Emerick [ 28/Feb/13 4:53 AM ]

Note that there are two other places where the Clojure reader is used in ClojureScript — one in the analyzer, one in the compiler — where a similar fix may be required. Perhaps cljs.compiler/forms-seq should be the sole place where the Clojure reader is used with *ns* properly tracked therein...

Comment by David Nolen [ 24/Apr/13 9:49 PM ]

Is this fixed in master?

Comment by David Nolen [ 29/Jul/13 10:37 PM ]

Ok this is not fixed in master, what's the point of removing the namespaces generated by ClojureScript?

Comment by Chas Emerick [ 30/Jul/13 5:20 AM ]

In this case, the created namespaces are guaranteed to be empty (only reading in that try, no evaluation), so removing them makes sense. As it is, ClojureScript leaves behind an empty namespace for each ns form it encounters and each js library it requires/aliases, which can be confusing / irritating (or at least inefficient) when using Clojure code completion or namespace browsing facilities in the same VM. I was hoping to avoid adding to that.

Comment by Chas Emerick [ 22/Oct/13 4:14 AM ]

This is fixed on master (and probably has been for a while?).

Comment by David Nolen [ 22/Oct/13 9:21 AM ]

Thanks for the update!

Generated at Wed Oct 18 08:01:07 CDT 2017 using JIRA 4.4#649-r158309.