mount

onetom 2017-02-16T04:45:52.000801Z

@arnout i was starting the system using this boot task:

(deftask refresh
  "Reload all changed namespaces on the classpath.
  Throws an exception in the case of failure."
  []
  (with-pass-thru _
    #_(apply tns/set-refresh-dirs (get-env :directories))
    (->> ["src"]
         (map abs-path)
         (apply tns/set-refresh-dirs))
    (with-bindings {#'*ns* *ns*
                    #'*e   *e}
      (mount/stop)
      (let [result (tns/refresh :after 'mount/start)]
        (when (instance? Throwable result)
          (throw result))))))

onetom 2017-02-16T04:48:39.000802Z

but i haven't been able to reproduce the issue since, so i suspect it's an error related to how the code evolves. as states are being added and removed, occasionally throwing exceptions during reloading...

onetom 2017-02-16T04:50:08.000803Z

but i might throw this whole auto reload approach away and just use cursive's "Sync files in REPL โ‡งโŒ˜M"....

onetom 2017-02-16T05:40:26.000804Z

actually, i can't do that conveniently because if i move a symbol definition from a namespace to another, that causes exceptions, like this:

java.lang.IllegalStateException: gen already refers to: #'test-helpers/gen in namespace: app.users-test
clojure.lang.Compiler$CompilerException: java.lang.IllegalStateException: gen already refers to: #'test-helpers/gen in namespace: app.users-test, compiling:(app/users_test.clj:1:1)
im wondering then what is the use of that "sync files" in cursive then if it just does a (require .... :reload); which is not very convenient. it seems i cant avoid clojure.tools.namespace.repl/refresh ๐Ÿ˜•