Hi, this snippet runs in the ansi-term and bash REPL, but evaluating it with cider-clj whether from within a .clj file directly or the REPL[clj ] throws these exceptions.
Code:
(def base-year 2006)
(def base-co2 382)
(defn co2 [year] (let [base-diff (* 2 (- year base-year)) ] (+ 382 base-diff)))
(co2 2020)
.clj file exception:
unhandled java.lang.IllegalStateException
Attempting to call unbound fn: #'user/co2
REPL[clj] exception:
unhandled clojure.lang.Compiler$CompilerException
Caused by java.lang.RuntimeException
unable to resolve symbol year in this context
System:
spacemacs 0.300.0@27.1.
Set up according to the practicalli install guide.
@hey2fo You should probably create a project when using Cider (Spacemacs Clojure layer commands). This will add a namespace definition, which is probably the issue here. There is a cider scratch buffer you could try if you don't create a project.