try to catch using - instead of _ in filenames so the compiler can give a better error message for people who don't know that you need to use _ in file names
Description
Environment
Attachments
Activity

Andy Fingerhut October 2, 2014 at 5:04 PM
clj-1297-v5.patch should be the one. I can only attempt to blame the previous bone-headed failure on lack of sleep, but even then ...

Alex Miller October 2, 2014 at 2:55 PM
The bad end colon is not fixed and the optional message is not included in the format string.

Andy Fingerhut October 2, 2014 at 6:06 AM
Patch clj-1297-v4.patch modifies only RT.load, including an extra message only if the file name in the argument contains a '_' character in it, with the message suggested by Alex Miller in his last comment before this.

Alex Miller October 1, 2014 at 9:05 PM
With latest:
That looks goofy due to the base message in RT.load(): throw new FileNotFoundException(String.format("Could not locate %s or %s on classpath: ", classfile, cljfile));
I would like to:
1) Fix that RT.load() message to not end with a colon: "Could not locate %s or %s on classpath."
2) Instead of changing load-one, just add the additional sentence in RT.load(). Second optional sentence could be: "Please check that namespaces with dashes use underscores in the Clojure file name."
Final message would then look like:
"Could not locate a_b__init.class or a_b.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name."

Andy Fingerhut October 1, 2014 at 12:45 AM
clj-1297-v3.patch is nearly identical to clj-1297-v2.patch, described in the previous comment, except it eliminates an unnecessary let expression.
Details
Details
Assignee
Reporter

Approval
Patch
Priority

Problem: Clojure requires the files that back a namespace that has dashes in it to have the dashes replaced with underscores on the filesystem (ie a.b_c.clj for namespace a.b-c). If you require a file that has been mistakenly saved as b-c.clj instead, you will get an error message:
Proposed:
Fix the bad ending colon in this sentence and add a second sentence only when the file name has an _ in it: "Please check that namespaces with dashes use underscores in the Clojure file name."
Patch: clj-1297-v5.patch
Screened by: Alex Miller