This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-11
Channels
- # admin-announcements (9)
- # arachne (1)
- # boot (125)
- # cider (5)
- # clara (34)
- # cljs-dev (11)
- # cljsjs (19)
- # clojure (164)
- # clojure-greece (7)
- # clojure-nl (2)
- # clojure-russia (5)
- # clojure-spec (3)
- # clojurescript (28)
- # clojurex (4)
- # core-async (3)
- # cursive (2)
- # datomic (3)
- # hoplon (268)
- # jobs (4)
- # keechma (2)
- # lambdaisland (1)
- # lein-figwheel (5)
- # leiningen (5)
- # off-topic (3)
- # om (3)
- # onyx (16)
- # re-frame (5)
- # reagent (31)
- # robots (1)
- # spacemacs (3)
- # specter (89)
- # untangled (1)
- # yada (26)
@devn: There isn’t any barrier to having non-Clojure types in a session. For fields, Clara will just fall back to using JavaBean properties if it can. https://github.com/rbrush/clara-rules/blob/0.11.1/src/main/clojure/clara/rules/compiler.clj#L165 You might get into trouble using things like Java primitives or maybe a falsey value, but I’d expect normal Java objects to work. As far as why, I work with @mikerod so I can speak to that; the short answer without saying too much is that while our group
group’s code is mostly in Clojure, we’re part of a larger Java system, and our external interaction points involve Avro records.
Oh, btw even though random Java objects are fine mutating them Java-style underneath the rules engine after inserting them isn’t, at least if you want predictable results 🙂
@devn correct. Not that facts have to be beans, it is just convenient for field access. You can always just use whatever functions/interop you want on the fact instead.
@wparker: i feel pretty daft asking, but again, im curious what an example of this looks like in clara's DSL
i've been musing about rules existing at other layers of our platform, which may select an existing avro schema, or produce a new one, for instance
@wparker: also, regarding #157 -- i honestly don't recall when we made that change, only that we observed cache misses due to ordering concerns
(defrule rule-using-bean [?fact <- AvroFact (meets-some-condition? field-on-AvroFact)] => whatever-RHS-you-want)
I suppose you could do interesting things with the fact-type-fn and Avro schemas, but that wasn’t what I was referring to
huh, i assumed there must be magic to make that work, but i must confess that my journey in programming has omitted serious java work, so while i understand chunks of the clojure compiler and such, i am often missing context w/r/t things like java beans
Well, I haven’t personally created those Avro models, so I can’t exclude magic completely 🙂
@wparker: also regarding 199 and your question about clojure equality, I don't think we've ever done anything with activation groups
Well, it wouldn’t have to be activation groups in particular, I was just choosing that as an example of one of the options to mk-session