Clojure

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

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Release 1.7
  • Component/s: None
  • Patch:
    Code
  • Approval:
    Ok

Description

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:

Exception in thread "main" java.io.FileNotFoundException: Could not locate a/b_c__init.class or a/b_c.clj on classpath:
...

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

  1. better-error-messages-for-require.diff
    14/Feb/14 2:29 PM
    3 kB
    Alexander Redington
  2. clj-1297-v3.patch
    30/Sep/14 6:45 PM
    1 kB
    Andy Fingerhut
  3. clj-1297-v5.patch
    02/Oct/14 11:04 AM
    1 kB
    Andy Fingerhut

Activity

People

Vote (11)
Watch (6)

Dates

  • Created:
    Updated:
    Resolved: