precept.macros
add-ns-if-special-form
(add-ns-if-special-form x)attr-only?
(attr-only? x)binding?!
(binding?! x cache)cache-binding!
(cache-binding! cache x)define
macro
(define & forms)CLJS version of define
defquery
macro
(defquery name & body)CLJS version of defquery
defsub
macro
(defsub kw & body)existing-binding?
(existing-binding? cache x)existing-session-def
(existing-session-def cenv session-name)Returns session definition hash-map matching session-name from registry in compiler-env or nil if no match found
fact-binding-with-type-only
(fact-binding-with-type-only expr)find-gen-in-lhs
(find-gen-in-lhs lhs)generate-rules
(generate-rules expr idx lhs rhs props)get-rule-defs
(get-rule-defs lhs rhs props)has-accumulator?
(has-accumulator? expr)merge-default-options
(merge-default-options options-in ancestors-fn)mk-parse-cache
(mk-parse-cache)(mk-parse-cache initial)options-map
(options-map sources-and-options)Returns arguments to session minus rule sources as hash-map.
parse-as-tuple
(parse-as-tuple expr)(parse-as-tuple expr cache)Parses rule expression as if it contains just a tuple. Does not take tuple as input! [ [] ], not []
parse-sexpr
(parse-sexpr sexpr)(parse-sexpr sexpr cache)parse-sub-rhs
(parse-sub-rhs rhs)parse-with-accumulator
(parse-with-accumulator expr)(parse-with-accumulator expr cache)Returns Clara DSL for ?binding <- (acc/foo) from [tuple]
parse-with-fact-expression
(parse-with-fact-expression expr)(parse-with-fact-expression expr cache)Returns Clara DSL for ?binding <- [tuple]
parse-with-op
(parse-with-op expr)(parse-with-op expr cache)Returns Clara DSL for [:op x], [:op [:op x] where x is :keyword, [:keyword] or [tuple]
parsed-sexpr?
(parsed-sexpr? xs)positional-value
(positional-value tuple)precept->clara-options
(precept->clara-options precept-options-map precept-options-keys)precept-options-keys
replace-at-index
(replace-at-index idx xs coll)Removes item at idx of coll and adds new list members (xs) starting at idx
rewrite-expr
(rewrite-expr expr cache)Returns Clara DSL for single expression
rewrite-lhs
(rewrite-lhs lhs)Returns Clara DSL for rule LHS
rule
macro
(rule name & body)CLJS version of rule
session
macro
(session m)(session name & sources-and-options)For CLJS. Wraps Clara’s defsession macro.
session*
macro
(session* m)(session* name & sources-and-options)sexpr?
(sexpr? x)sexprs-with-bindings
(sexprs-with-bindings tuple)(sexprs-with-bindings tuple cache)[(:id ?v) :foo ‘bar’] -> [:foo (= (:id ?v) (:e this)) [?e :foo (> 42 ?v)] -> [:foo (= ?v (:v this)) (> 42 (:v this))]
sources-list
(sources-list sources-and-options)Returns rule sources from arguments to session as list.
special-form?
(special-form? x)special-forms
store-session-def-in-compiler!
(store-session-def-in-compiler! session-def)Stores session definition in cljs.env/*compiler*. May be accessed to recreate a session with identical name, arguments.
test-expr?
(test-expr? x)trace
(trace & args)value-expr?
(value-expr? x)variable-bindings
(variable-bindings tuple)(variable-bindings tuple cache)