This is my problem:
I need run some code every time I open a new repl, searching in Google I found that I can use the file init.clj or the user.clj (with Leiningen)
This is the code I need to run:
(set! *print-length* 103)
(println "hello")
(println *print-length*)
These are the results with both of the files:
[~/project]$ lein repl
hello <- this is the println, so the file is excecuted
103 <- this is the println of *print-length* apparently change
REPL started; server listening on localhost port 20875
user=> *print-length*
nil <- but the val of *print-length* don't change
Is there something I need to do or do I have some error?
Thanks to all!
(alter-var-root #'*print-length* (constantly 103))in~/user.cljworks for me.As far as I know
set!doesn’t work outside of abinding‘s dynamic scope.