This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-18
Channels
- # beginners (15)
- # boot (23)
- # cider (8)
- # clara (29)
- # cljs-dev (86)
- # cljsrn (36)
- # clojars (9)
- # clojure (211)
- # clojure-dusseldorf (5)
- # clojure-italy (21)
- # clojure-sg (2)
- # clojure-spec (4)
- # clojure-uk (12)
- # clojurescript (204)
- # cursive (5)
- # data-science (12)
- # datomic (15)
- # dirac (99)
- # emacs (1)
- # events (2)
- # figwheel (1)
- # fulcro (9)
- # graphql (27)
- # hoplon (50)
- # instaparse (9)
- # juxt (61)
- # keechma (6)
- # leiningen (1)
- # luminus (4)
- # lumo (24)
- # off-topic (24)
- # om (16)
- # onyx (17)
- # parinfer (35)
- # pedestal (3)
- # planck (12)
- # protorepl (8)
- # re-frame (15)
- # reagent (22)
- # ring (1)
- # rum (1)
- # spacemacs (3)
- # uncomplicate (4)
- # vim (5)
- # yada (1)
cljs.user=> (require 'clara.rules)
⬆
WARNING: macroexpand already refers to: cljs.core/macroexpand being replaced by: clojure.reflect/macroexpand at line 33 clojure/reflect.cljs
⬆
WARNING: Use of undeclared Var schema.utils$macros/class at line 25 schema/utils.clj
⬆
WARNING: Use of undeclared Var schema.utils$macros/class at line 32 schema/utils.clj
⬆
WARNING: Use of undeclared Var schema.utils$macros/format at line 36 schema/utils.clj
⬆
WARNING: No such namespace: clojure.lang.Compiler, could not locate clojure/lang/Compiler.cljs, clojure/lang/Compiler.cljc, or Closure namespace "" at line 49 schema/utils.clj
⬆
WARNING: Use of undeclared Var clojure.lang.Compiler/CHAR_MAP at line 49 schema/utils.clj
⬆
WARNING: Use of undeclared Var schema.utils$macros/class at line 64 schema/utils.clj
⬆
WARNING: Use of undeclared Var schema.utils$macros/print-method at line 95 schema/utils.clj
⬆
WARNING: Use of undeclared Var schema.utils$macros/print-method at line 96 schema/utils.clj
⬆
WARNING: Use of undeclared Var schema.utils$macros/print-method at line 116 schema/utils.clj
⬆
WARNING: Use of undeclared Var schema.utils$macros/print-method at line 117 schema/utils.clj
⬆
WARNING: No such namespace: java.util.Collections, could not locate java/util/Collections.cljs, java/util/Collections.cljc, or Closure namespace "" at line 141 schema/utils.clj
⬆
WARNING: Use of undeclared Var java.util.Collections/synchronizedMap at line 141 schema/utils.clj
⬆
WARNING: Use of undeclared Var schema.utils$macros/class? at line 147 schema/utils.clj
⬆
WARNING: Use of undeclared Var schema.utils$macros/class at line 148 schema/utils.clj
ERROR in file schema/utils.clj
(new)
Function.cljs.core.ex_info.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:1935:200)
Function.cljs.analyzer.error.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:2482:92)
(NO_SOURCE_FILE <embedded>:5947:100)
z (NO_SOURCE_FILE <embedded>:5948:13)
(NO_SOURCE_FILE <embedded>:5942:232)
(NO_SOURCE_FILE <embedded>:5862:482)
Object.cljs.js.load_macros (NO_SOURCE_FILE <embedded>:5838:464)
(NO_SOURCE_FILE <embedded>:5857:20)
Object.cljs.js.load_macros (NO_SOURCE_FILE <embedded>:5838:464)
No protocol method IMultiFn.-add-method defined for type undefined:
Object.cljs.core.missing_protocol (NO_SOURCE_FILE <embedded>:179:229)
cljs.core._add_method (NO_SOURCE_FILE <embedded>:1841:468)
(evalmachine.<anonymous>:272:23)
ContextifyScript.Script.runInThisContext (vm.cljs:44:33)
Object.runInThisContext (vm.cljs:116:38)
(Object.lumoEval)
lumo.repl.caching_node_eval (NO_SOURCE_FILE <embedded>:6211:68)
(NO_SOURCE_FILE <embedded>:5947:29)
z (NO_SOURCE_FILE <embedded>:5948:13)
(NO_SOURCE_FILE <embedded>:5942:232)
@iku000888 supporting self-hosted ClojureScript in Clara isn’t something we’ve looked at to my knowledge, and I would anticipate that changes would need to be made to support it. If anyone has gotten that to work it would be interesting to know though. From the looks of your errors Schema has some problems with self-hosted ClojureScript as well, so there might need to be changes there as well for self-hosted CLJS Clara to work. Feel free to log an issue to Clara and anyone who wants to look at what that would take is welcome to do so. It would be nice to have, it just hasn’t been a priority. I canof how Schema would approach any problems with self-hosted ClojureScript in their codebase,
I can’t speak to how Schema would approach any problems with self-hosted ClojureScript in their codebase, and I don’t know if there have been any previous discussions on the subject, but in my observation they’ve been pretty open to PRs, issues, etc. in the past
Will log an issue on the clara repo and schema (after checking they have an issue on self host)
that works thanks @iku000888
There would need to be some changes to Clara as well for this, not just Schema. A quick one that jumps out is that clara.rules.compiler is a clj file and has a java.beans.PropertyDescriptor import
https://github.com/cerner/clara-rules/blob/master/src/main/clojure/clara/rules/compiler.clj#L1
@enn I’ll add on more possibility to this:
> Can an accumulator accumulate across more than one fact type (joined on some field)? All of the examples show only a single fact type in the :from
clause.
You can also “wrap” multiple types of facts in a common fact type and accumulate instead on that.
(defrecord CommonWrap [wrapped])
(r/defrule wrap-fact-a
[?a <- FactA]
=>
(r/insert! (->CommonWrap ?a)))
(r/defrule wrap-fact-b
[?b <- FactB]
=>
(r/insert! (->CommonWrap ?b)))
(r/defrule accum-them
[?acc <- my-accumulator :from [CommonWrap]]
<etc>
=>
<rhs>)
or you could make it have the same fields as the original even with
(r/insert! (->CommonWrap ?a))