librelist archives

« back to archive

Honor :init-ns in lein repl

Honor :init-ns in lein repl

Marko Topolnik
2013-01-09 @ 18:22
With leiningen 2.0.0-preview10, I want to use :repl-options {:init-ns ...}
and have it honored by all clients that connect to the resulting nrepl. 
Howewer, it is only honored by the immediate REPLy client. I studied the 
issue #788 [1] and the pull request #818, resulting in the line [2] in 
repl.clj, which should be the fix. By the looks of it, I expect the result
to be behavior inconsistent between headful and headless modes: in 
headless it will work as expected, but in headful it will just keep 
working same as now, meaning no other client except the immediate REPLy 
client will benefit from :init-ns. I haven't been able to test this for 
myself (it is not as trivial as git clone leiningen, lein uberjar) so I 
would like to confirm this: 

Is the new expected behavior to have every nrepl client, regardless of 
headless/ful mode, observe the initial namespace upon connection as 
specified by :init-ns?