1. Why does uberjar work differently with REPL?
The reason for the "NO_SOURCE_PATH" error is that you are not in the namespace that defined "foo".
: REPL , contact-form.core, , (ns contact-form.core) REPL, user -main :
contact-form.core=> (-main)
foo value is: Hello World!
nil
contact-form.core=> (ns user)
nil
user=> (contact-form.core/-main)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: foo in this context, compiling:(NO_SOURCE_PATH:120)
user=>
, main uberjar ( REPL), (contact-form.core/-main) , clojure.core, (ns contact-form.core) . : main ( ) , contact-form.core .
2.
.:
(defn -main [& args]
(use 'contact-form.core)
(some-func 'foo))