Liking cljdoc? Tell your friends :D

odoyle.rules


*match*clj/s

Provides a map of all the matched values from inside a :then block. This is no longer necessary, because it is accessible via match directly.

Provides a map of all the matched values from inside a :then block.
This is no longer necessary, because it is accessible via `match` directly.
sourceraw docstring

*session*clj/s

Provides the current value of the session from inside a :then or :then-finally block. This is no longer necessary, because it is accessible via session directly.

Provides the current value of the session from inside a :then or :then-finally block.
This is no longer necessary, because it is accessible via `session` directly.
sourceraw docstring

->ruleclj/s

(->rule [rule-name parsed-rule])
(->rule rule-name rule)

Returns a new rule. In most cases, you should use the ruleset macro to define rules, but if you want to define rules dynamically, you can use this function instead. See the README section "Defining rules dynamically". The one-argument arity is only meant for internal use.

Returns a new rule. In most cases, you should use the `ruleset` macro to define rules,
but if you want to define rules dynamically, you can use this function instead.
See the README section "Defining rules dynamically".
The one-argument arity is only meant for internal use.
sourceraw docstring

->sessionclj/s

(->session)

Returns a new session.

Returns a new session.
sourceraw docstring

add-ruleclj/s

(add-rule session rule)

Adds a rule to the given session.

Adds a rule to the given session.
sourceraw docstring

contains?clj/s

(contains? session id attr)

Returns true if the session contains a fact with the given id and attribute.

Returns true if the session contains a fact with the given id and attribute.
sourceraw docstring

fire-rulesclj/s

(fire-rules session)
(fire-rules session opts)

Fires :then and :then-finally blocks for any rules whose matches have been updated. The opts map may contain:

:recursion-limit - Throws an error if rules recursively trigger this many times. The default is 16. Pass nil to disable the limit entirely.

Fires :then and :then-finally blocks for any rules whose matches have been updated.
The opts map may contain:

:recursion-limit  -  Throws an error if rules recursively trigger this many times.
                     The default is 16. Pass nil to disable the limit entirely.
sourceraw docstring

insertclj/s

(insert session [id attr value])
(insert session id attr->value)
(insert session id attr value)

Inserts a fact into the session. Can optionally insert multiple facts with the same id.

Note: if the given fact doesn't match at least one rule, it will be discarded.

Inserts a fact into the session. Can optionally insert multiple facts with the same id.

Note: if the given fact doesn't match at least one rule, it will be discarded.
sourceraw docstring

insert!clj/s

(insert! id attr->value)
(insert! id attr value)

Equivalent to:

(o/reset! (o/insert o/session id attr value))

Equivalent to:

(o/reset! (o/insert o/*session* id attr value))
sourceraw docstring

parseclj/s

(parse spec content)
source

query-allclj/s

(query-all session)
(query-all session rule-name)

When called with just a session, returns a vector of all inserted facts. Otherwise, returns a vector of maps containing all the matches for the given rule.

When called with just a session, returns a vector of all inserted facts.
Otherwise, returns a vector of maps containing all the matches for the given rule.
sourceraw docstring

remove-ruleclj/s

(remove-rule session rule-name)

Removes a rule from the given session.

Removes a rule from the given session.
sourceraw docstring

reset!clj/s

(reset! new-session)

Mutates the session from a :then or :then-finally block.

Mutates the session from a :then or :then-finally block.
sourceraw docstring

retractclj/s

(retract session id attr)

Retracts the fact with the given id + attr combo.

Retracts the fact with the given id + attr combo.
sourceraw docstring

retract!clj/s

(retract! id attr)

Equivalent to:

(o/reset! (o/retract o/session id attr))

Equivalent to:

(o/reset! (o/retract o/*session* id attr))
sourceraw docstring

rulesetclj/smacro

(ruleset rules)

Returns a vector of rules after transforming the given map.

Returns a vector of rules after transforming the given map.
sourceraw docstring

wrap-ruleclj/s

(wrap-rule
  rule
  {what-fn :what when-fn :when then-fn :then then-finally-fn :then-finally})

Wraps the functions of a rule so they can be conveniently intercepted for debugging or other purposes. See the README section "Debugging".

Wraps the functions of a rule so they can be conveniently intercepted
for debugging or other purposes.
See the README section "Debugging".
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close