# HG changeset patch # User Steve Losh # Date 1467835707 0 # Node ID f7b7440c46ff9ab481a256f8841059197758aa7f # Parent 0955ab257feff6918be8a96b51ab8f1af6683325 Clean up the rule UI too diff -r 0955ab257fef -r f7b7440c46ff src/wam/ui.lisp --- a/src/wam/ui.lisp Wed Jul 06 18:30:31 2016 +0000 +++ b/src/wam/ui.lisp Wed Jul 06 20:08:27 2016 +0000 @@ -17,24 +17,24 @@ ;;;; Assertion -(defun add-rule (clause) - (wam-logic-frame-add-clause! *database* clause) +(defun invoke-rule (head &rest body) + (wam-logic-frame-add-clause! *database* (list* head body)) (values)) -(defun add-fact (fact) - (add-rule (list fact)) +(defun invoke-fact (fact) + (invoke-rule fact) (values)) -(defun add-facts (facts) +(defun invoke-facts (&rest facts) (mapc #'add-fact facts) (values)) -(defmacro rule (&body body) - `(add-rule ',body)) +(defmacro rule (head &body body) + `(invoke-rule ',head ,@(loop :for term :in body :collect `',term))) (defmacro fact (fact) - `(add-fact ',fact)) + `(invoke-fact ',fact)) (defmacro facts (&body facts) `(progn