This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-14
Channels
- # beginners (33)
- # boot (38)
- # clara (21)
- # cljs-dev (1)
- # cljsjs (2)
- # cljsrn (12)
- # clojure (230)
- # clojure-argentina (1)
- # clojure-brasil (3)
- # clojure-dusseldorf (4)
- # clojure-france (9)
- # clojure-italy (1)
- # clojure-russia (123)
- # clojure-spec (46)
- # clojure-turkiye (1)
- # clojure-uk (60)
- # clojurescript (83)
- # core-async (6)
- # cursive (10)
- # datascript (19)
- # datomic (28)
- # defnpodcast (1)
- # emacs (7)
- # figwheel (7)
- # fulcro (29)
- # leiningen (29)
- # lumo (9)
- # off-topic (14)
- # om (1)
- # onyx (25)
- # pedestal (1)
- # protorepl (3)
- # re-frame (10)
- # reagent (41)
- # ring-swagger (11)
- # shadow-cljs (10)
- # testing (5)
- # unrepl (3)
- # vim (3)
Yes, it's at session creation.
i cant get parameters to work unless they are used in a binding though. that doesnt seem right.
(clara.rules/defquery ship-destroyed-at?
[:?point]
[?destroyed <- Destroyed (= ?ship ship)]
[?placement <- ValidPlacement
(= ?ship ship)
((spaces this) ?point)])
for the record this doesnt seem to work either so its not the test nodeYeah, my first recommendation was going to be to not use a :test
node when it isn’t necessary (although I’d still expect that to work)
if i had to guess, the check this exception uses is too special cased and doesnt consider parameters.
The above queries won't work because ?point is not bound, although we could be more clear in our error messaging here.
The :?point is a query parameter, which just does a lookup. A query parameter is not "bound" when the rule engine is processing...it is simple used to look up bound values.
These semantics are a bit confusing in this case because we're conflating query parameters (which do not bind a variable) with variables that must be bound with an (= ?my-variable ...) or similar expression.
So presumably the way to attack this is to make a new fact using those conditions, rather than trying to just query?
@dave.dixon Separating this out into another fact makes sense. I'm not quite sure what your objective for these rules is, but any approach that explicitly binds ?point in the query logic (not just the parameter) should work.
That worked great, thanks.