This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-15
Channels
- # announcements (1)
- # architecture (8)
- # babashka (7)
- # beginners (5)
- # biff (8)
- # calva (24)
- # cider (9)
- # clerk (14)
- # clj-kondo (7)
- # clojars (14)
- # clojure (49)
- # clojure-europe (11)
- # clojure-nl (1)
- # clojure-norway (90)
- # clojure-uk (3)
- # clojurescript (5)
- # core-typed (70)
- # cursive (35)
- # data-science (4)
- # datalevin (6)
- # datomic (2)
- # emacs (3)
- # fulcro (1)
- # holy-lambda (1)
- # hyperfiddle (5)
- # lsp (26)
- # malli (28)
- # off-topic (9)
- # re-frame (21)
- # releases (1)
- # shadow-cljs (7)
- # squint (6)
- # testing (14)
that was surprisingly quick https://chromewebstore.google.com/detail/shadow-cljs-ui/hpcbebiekdogcnamniekdaknicncdban
Hmmm, has anyone encountered an error like this before?
------ WARNING #1 - :undeclared-var --------------------------------------------
File: /Users/matthew/.gitlibs/libs/io.github.inferenceql/inferenceql.inference/40e77dedf680b7936ce988b66186a86f5c4db6a5/src/inferenceql/inference/gpm/conditioned.cljc:21:8
--------------------------------------------------------------------------------
18 | gpm.proto/Condition
19 | (condition [_ new-conditions]
20 | (let [merged-conditions (merge conditions new-conditions)]
21 | (->ConditionedGPM gpm merged-conditions))))
--------------^-----------------------------------------------------------------
Use of undeclared Var inferenceql.inference.gpm.conditioned/->ConditionedGPM
--------------------------------------------------------------------------------
22 |
23 | (defn condition
24 | "Conditions gpm based on conditions via rejection sampling. Arguments are the
25 | same as those for `inferenceql.inference.gom/condition`."
--------------------------------------------------------------------------------
This in the middle of a (defrecord ConditionedGPM ...)
, so it's just trying to construct and return a new instance of the same record. It's a cljc file, and it works just fine in Clojure, but I can't figure out why shadow is complaining. We don't have to declare
the arrow constructors in cljs, right?might be a bug in CLJS. just swap ->ConditionedGPM
to ConditionedGPM.
, that'll work in both envs
Or maybe use extend after the defrecord? I did not know it was possible to refer to the defrecord-generated constructor within the defrecord form!
@U05224H0W Yep, that worked.
@U0HG4EHMH In clj, if you look at the defrecord macro, it emits a declare
for the ->Foo and map->Foo symbols right off the bat. It looks like the cljs equivalent, build-positional-factory
, doesn't happen until the end of the macro, which might be the cause.
Undefined behavior, looking at https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/defrecord
Weird update: in Clojure, it's a compilation error with deftype, but not defrecord, which is weird.