I struggle to evaluate a string contains a function call. The function is defined in the same namespace where the evaluation happens. Everything works well if a symbol comes from a library referring inside ns body like: (ns myname.myapp (:require [clj-time.core])).
My goal is to load a file (edn format) that interops with custom symbols. Here is a bare minimum setup to reproduce the issue:
(ns myname.myapp
(:import [java.time Instant])
(:gen-class))
(defn time-now []
(->
(Instant/now)
(.toString)))
(defn -main [& args]
(prn (eval (read-string "{:now (time-now)}"))))
If I evaluate sexp by sexp inside the source file buffer everything ok, but cli execution clj -m myname/myapp leads to Unable to resolve symbol: time-now in this context. Any ideas? Thank you in advance.