Fork me on GitHub
#clara
<
2019-04-05
>
eraserhd17:04:58

ha! I just found out that (-> session inspect :insertions keys * :name) is not a fully qualified symbol, but a symbol with a slash in the name part.

4
mikerod17:04:32

I do not get it 😵

👆 4
mikerod17:04:42

doing crazy things with the symbol fn?

devn20:04:10

What is * in there @eraserhd? When you say symbol do you mean keyword? I had the same thought as mikerod: (symbol "not/valid")

eraserhd20:04:56

* was pseudo-code for "some integer". I guess first would actually work.

eraserhd20:04:31

the value at :name on a rule map is a symbol

wparker16:04:39

When I tried this I got a string:

clara.other-ruleset=> (-> (mk-session) (insert (->ColdAndWindy 15 15)) fire-rules inspect/inspect :insertions  keys first :name)
"clara.other-ruleset/is-lousy"
clara.other-ruleset=> (-> (mk-session) (insert (->ColdAndWindy 15 15)) fire-rules inspect/inspect :insertions  keys first :name class)
java.lang.String 
Do you have a reproducing case or maybe I’m misunderstanding something?

wparker16:04:06

clara.other-ruleset is a test namespace in Clara

eraserhd17:04:58

Here's the function: https://gist.github.com/eraserhd/b7276d42de798e04b3f1cda0fb8e76ab ... I don't see that I'm doing anything weird there...

eraserhd17:04:54

However, a bunch of rules are generated by some macros. I'm pretty sure they expand clara.rules/defrule with a normal, unqualified symbol. But maybe something in the macros is weird?

eraserhd17:04:49

(the code on line 22 in the gist was added to work around the observed problem)