Uploaded image for project: 'Clojure'
  1. CLJ-1297

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: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Completed
    • Affects versions: None
    • Fix versions: Release 1.7
    • Approval:
      Ok
    • Patch:
      Code

      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

        Attachments

        1. better-error-messages-for-require.diff
          3 kB
          Alexander Redington
        2. clj-1297-v3.patch
          1 kB
          Andy Fingerhut
        3. clj-1297-v5.patch
          1 kB
          Andy Fingerhut

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hiredman Kevin Downey
            • Votes:
              6 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: