Thanks, defonce seems to solve the problem.
As there doesn't seem to be a logical explanation for why the
vartest.test-data namespace is evaluated twice I filed this as a leiningen
issue:
https://github.com/technomancy/leiningen/issues/1519
::Antti::
--
You received this message
I thought that once defined clojure vars are immutable and retain their
values. However, I
accidentally bumped into a situation where I observe the same var in two
different states.
Here's how to reproduce:
lein new app vartest
Add the following files to the test folder:
-
(ns
When a namespace is reloaded any vars defined in it are re-evaluated. In
your case it would seem that some quirk of the Leiningen test architecture
is leading to vartest.test-data being loaded twice.
In general namespaces should be robust when it comes to being reloaded.
Clojure provides a macro,