Case insensitivity of compiler

70 views
Skip to first unread message

Mark Engelberg

unread,
Jun 7, 2013, 1:23:29 PM6/7/13
to clojure-dev
I recently ran into something that I suppose could be classified as a compiler bug, or at a minimum, a "gotcha":

In my file, I had a function called Parser->str and another called parser->str.
In the REPL, everything was hunky dory.

However, I started getting bug reports from users who were compiling the code into an uberjar on filesystems without case sensitivity (Windows and most Macs).  Apparently, as the compiler was generating files for these functions, the file for parser->str was clobbering the file for Parser->str.

I don't know if there's an easy way to fix the compiler, but it seems to me that if the compiler can't or won't be fixed, the Clojure community needs to be made aware that you can't rely on case sensitivity in Clojure code, and that such code will break when compiled on the vast majority of systems.  Perhaps there is a useful warning that the compiler could emit.

Andy Fingerhut

unread,
Jun 10, 2013, 8:27:00 PM6/10/13
to cloju...@googlegroups.com
It appears that Clojure inherits this from the JVM.  The Eclipse ticket linked below has links to half a dozen tickets with "bugs.sun.com" in their URLs in case you are curious to find them in the comments:

    https://bugs.eclipse.org/bugs/show_bug.cgi?id=321115

It appears that a workaround is if you can get the class files into a zip file, then the zip file effectively implements a case-sensitive file system inside of it.

The only thing that seems to be Clojure-specific about this behavior is that it may not be obvious to Clojure programmers which things in the source code map to JVM classes and which do not.

A warning from the Clojure compiler would be nice, but I haven't looked into how difficult it might be to implement.

Andy



--
You received this message because you are subscribed to the Google Groups "Clojure Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure-dev...@googlegroups.com.
To post to this group, send email to cloju...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojure-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages