clara

http://www.clara-rules.org/
Brian Abbott 2020-08-06T15:28:09.276Z

Hi, I am having a problem with resolving a defrecord call that resides in a seperate namespace from the rule defininitions. I was wondering if someone might be able to help me out. I have the code I made for a small prototype that repros the issue here: https://github.com/briancabbott/clara-rules-test

2020-08-06T15:38:45.277200Z

@briancabbott in CLJ to refer to a defrecord created type you have to use the java interop :import

2020-08-06T15:39:08.277900Z

So it’s not represented as a var. so :require + :refer won’t work.

2020-08-06T15:39:40.278600Z

It’s somewhat unfortunate. In CLJS you actually can refer to them as non-interop style symbols.

2020-08-06T15:41:09.280600Z

So something like. : `(:import [ clara_rules_test.parent_rules_split_ns.rule_records MyFirstRecordOne MyFirstRecordTwo])`

2020-08-06T15:41:54.282Z

Not also the need for underscores instead of hyphens. Again. That’s the java interop part. Cannot have hyphens in class names on JVM so clj converts them (called “munching”) to underscores.

Brian Abbott 2020-08-06T16:23:19.282600Z

BAM!!! HELL YES! 🙂 Thank you my friend --- you are my Savior!

👍 1
Brian Abbott 2020-08-06T16:23:32.282900Z

@mikerod

2020-08-06T16:41:34.283200Z

🙌

eraserhd 2020-08-06T20:44:30.285800Z

It's been a while... are there any issues with [:not [:exists ...]]? I have a rule that is firing, even though the LHS has [:exists A] [:not [:exists A]].

ethanc 2020-08-07T14:07:52.286900Z

Thats an interesting scenario, i will have to look into whats going on there

eraserhd 2020-08-06T20:49:40.286500Z

oh, while that is not correct, it is actually silly to say [:not [:exists A]] instead of [:not A], huh