Fork me on GitHub
#calva
<
2022-12-05
>
skylize01:12:59

Case • File foo.cljc creates a Record.

(ns foo)
(defrecord Foo ...)
• File bar.cljc refers the the generated constructor function ->Foo.
(ns bar
  (:require [foo :refer [->Foo]]))
• Clean fresh jacked in repl, with all files saved. If I evaluate the ns declaration of bar, I get an IllegalAccessError that ->Foo does not exist. Problem goes away if I load the foo namespace manually.

pez06:12:10

I don't have this. Can you reproduce it with something as simple as this:

├── deps.edn
└── src
    ├── bar.cljc
    └── foo.cljc
deps.edn
{}
foo.cljc
(ns foo)

(defrecord Foo [field])
bar.cljc
(ns bar
  (:require [foo :refer [->Foo]]))

(comment
  (->Foo "hello")
  :rcf)
? If I: 1. jack-in 2. evaluate the bar ns form 3. evaluate the expression in the RCF I get: #foo.Foo{:field "hello"}.

skylize15:12:13

Actually, no. I guess I need more digging to pin this down. 😕

pez15:12:00

I think this would be very good to pin down. There are things about the loading/evaluating of files that I think could benefit the Calva Ux if we figured out.

👍 1
skylize02:12:20

Seems to have magically self-corrected in the problem project now. 🤷

pez06:12:45

¯\(ツ)