3

I can pass clojure.main/repl a function that will be used to eval input (thanks to the :eval keyword). But how can I do this with nrepl? I read a bit about handlers but it quickly becomes hard and abstract to follow.

Also, since I mainly launch it with lein repl, is there a way to specify my eval in the project.clj file? :repl-options doesn't seem to accept the :eval keyword.

Gra
  • 1,542
  • 14
  • 28

1 Answers1

0

Take a look at the interruptible-eval middleware: https://github.com/clojure/tools.nrepl/blob/master/src/main/clojure/clojure/tools/nrepl/middleware/interruptible_eval.clj

You could make something similar and start the nrepl manually using the start-server function. Or there is a lein option for nrepl middlewares.