clj-commons/camel-snake-kebab

Library is incompatible with AOT compilation

Closed this issue · 15 comments

This isn't really a bug per-se with camel-snake-kebab (which is fab!) but I thought you should know that it doesn't deploy on Tomcat 6/7 or 8 with either JDK 6 or 7. It fails with NoClassDefFoundError:camel_snake_kebab/core$__GT_CamelCaseString(wrong name: camel_snake_kebab/core$__GT_camelCaseString).

EDIT: it also fails with the downloaded jetty distribution (i.e. building a war and dropping it into jetty/webapps).

Running it through lein repl works fine, it is just something funny with Tomcat and jetty. Thought you might like to know :).

Nailing this down - it seems lein ring uberwar is extracing compiling the contents of JARs into WEB-INF/classes as well as including them in WEB-INF/lib. So WEB-INF/lib contains:

snapshot1

Given that windows is case insensitive it gets confused. I guess this is a bug in ring then...

After discussing with weavejester it seems this is an expected effect of Clojure's AOT compilation, in which case a sensible enhancement request would be to not have function names that only differ by case. Is this possible? (I realise this is a breaking change...)

[…] in which case a sensible enhancement request would be to not have function names that only differ by case. Is this possible? (I realise this is a breaking change...)

I consider the quirky function names half the charm of this library so I won't change them.

But I definitely need to document this issue and check if OS X is affected too.

You might want to switch to https://github.com/ToBeReplaced/lettercase that shouldn't have this issue.

(Sorry for the late reply. I've been relocating my home this week.)

My turn for the late reply :). No worries - thanks for the update anyway.

Does a library that prefers "charm" over "works on dominant operating systems" merit serious consideration?

@jcromartie: That's obviously a fair question (if you keep the AOT aspect in it). I'm not happy with the current situation either, but I haven't figured out a solution that does not involve pointing everybody to https://github.com/ToBeReplaced/lettercase instead.

I find camel-snake-kebab to be a very useful library, but this is indeed a bummer for those of us who want to make a .war file for example using AOT. While I also don't have a great solution to this and I also like the naming conventions of the library, I personally wouldn't care if there was a simple suffix/prefix to conflicting methods (I don't think it takes much away from the charm and would help not deter people from using the library). For example, take ->camelCaseString and ->CamelCaseString

We could use one of the following for example (not the most ideal solution but I agree with @jcromartie that this would be better than doing nothing at all and I think most people would understand why this decision was made):

->CamelCaseString*
=>CamelCaseString
->>CamelCaseString
->_CamelCaseString
->CamelCaseString'

Cheers

I realized more people than I first expected run into this and therefore created pull request #24 to resolve this issue. Feedback is more than welcome.

I like PascalCase as it is more descriptive with the association to Pascal.
http://en.wikipedia.org/wiki/Snake_case suggests either spinal_case or
screaming_snake_case.

On 11 January 2015 at 18:15, Christoffer Sawicki notifications@github.com
wrote:

I realized more people than I first expected run into this and therefore
created pull request #24
#24 to resolve this
issue. Feedback is more than welcome.


Reply to this email directly or view it on GitHub
#15 (comment)
.

SCREAMING_SNAKE_CASE would be funny. Any votes against? 🌝

+1 from me.
On 11 Jan 2015 18:46, "Christoffer Sawicki" notifications@github.com
wrote:

SCREAMING_SNAKE_CASE would be funny. Any votes against? [image:
🌝]


Reply to this email directly or view it on GitHub
#15 (comment)
.

Fixed in master and 0.3.0-SNAPSHOT on Clojars. Will do a proper release this weekend.

I've released 0.3.0 now.

Thanks Christoffer.

On 17 January 2015 at 19:05, Christoffer Sawicki notifications@github.com
wrote:

I've released 0.3.0 now.


Reply to this email directly or view it on GitHub
#15 (comment)
.