Fix defrule definition
This commit is contained in:
parent
ade32d5bb9
commit
8750b11812
@ -42,11 +42,11 @@
|
|||||||
"Adds a new rule to the database."
|
"Adds a new rule to the database."
|
||||||
(db/add-rule db (query-syntax-process rule)))
|
(db/add-rule db (query-syntax-process rule)))
|
||||||
|
|
||||||
(defmacro defrule [db conclusion body]
|
(defmacro defrule! [db conclusion body]
|
||||||
"Convenience macro to add a new rule to the database.
|
"Convenience macro to add a new rule to the database.
|
||||||
|
|
||||||
Usage:
|
Usage example:
|
||||||
(defrule [grandparent ?x ?y]
|
(defrule [grandparent ?x ?y]
|
||||||
(and [parent ?x ?z]
|
(and [parent ?x ?z]
|
||||||
[parent ?z ?y]))"
|
[parent ?z ?y]))"
|
||||||
`(add-rule! ~db (quote [conclusion body])))
|
`(add-rule! ~db (quote [~conclusion ~body])))
|
||||||
|
Loading…
Reference in New Issue
Block a user