clr

Nazral 2024-10-08T15:37:18.775519Z

Hi @dmiller Archibald from Georgetown Software House, I've been trying to use reader conditionals with cljr + clr.tools.nrepl and I get the following error

clojure.lang.ExceptionInfo: Conditional read not allowed
{:type :reader-exception, :line 1, :column 10, :file nil}
 at clojure.tools.reader$read_STAR___23008.invokeStatic (:0)
    clojure.tools.nrepl.impl.utils$parse_next__23140.invokeStatic (:0)
    clojure.tools.nrepl.impl.server/eval_msgfn__28220fn__28225 (:0)
    clojure.tools.nrepl.impl.server/eval_msgfn__28220 (:0)
    clojure.core$with_bindings_STAR___1966.invokeStatic (:0)
    clojure.tools.nrepl.impl.server$eval_msg__28235.invokeStatic (:0)
Caused by: System.Exception: Conditional read not allowed
 at clojure.tools.reader$read_cond__22837.invokeStatic (:0)
    clojure.tools.reader/read_cond (:0)
    clojure.tools.reader$read_dispatch__22571.invokeStatic (:0)
    clojure.tools.reader/read_dispatch (:0)
    clojure.tools.reader$read_STAR___23008.invokeStatic (:0)
Any idea where that comes from by any chance?

dmiller 2024-10-08T16:35:33.115949Z

The edn reader does not support conditionalization. To get around this, cljr looks for a deps-clr.edn file before deps.edn

Nazral 2024-10-09T12:56:28.186509Z

right but the conditionals are in a .cljc file, and I am using deps-clr.edn. Would the best solution, currently, be to create two libs for the clj & cljr code with same namespace, and import the clj one in deps.edn and the cljr one in deps-clr.edn ?

dmiller 2024-10-09T14:57:35.094999Z

I think splitting is the only solution. Wish 'twere otherwise.

👍 1
Nazral 2024-10-09T15:06:31.498639Z

thank you for the answer !