tags:

views:

48

answers:

1

I noticed that (use 'somemodule :reload) doesn't reload the module if the .clj file was not modified.

However I have an usecase for forcing the reload of the module even if the file isn't changed. I created a haml macro for clojure which reads an external file and generates clojure code.

( http://www.coldcode.net/2010/10/haml-macro-for-clojure.html )

I would like thus to be able to reload the clojure module regardless of the file timestamp.

Does anybody know if it's possible? (I would like to avoid touching the file from outside of my editor)

EDIT: I use clojure 1.2, leiningen 1.3.1

+1  A: 

:reload will force reloading of the module.

But it sounds as if you use AOT compilation and clojure resorts to the AOT compiled .class files instead of the source. If you don't need AOT compilation (read: gen-class in 99% of the cases, no dynamic byte code gen on the host vm in the rest) don't use it. If you really need AOT compilation, I can only think of removing the .class files for the namespace.

kotarak
yes, actually I found out. Leiningen was eating compiler errors. I had to write something (like "1") and hit enter to see them. This confused me
ithkuil
Sounds like you hit a repl bug in 1.3.1. It's fixed in 1.4.0-SNAPSHOT, which should hit a stable release in a week or two.
technomancy
ah great, I will give a try to 1.4.0-SNAPSHOT then
ithkuil