I'm trying to program a common-lisp macro (sbcl) to set the syntax for defining a rule in a rule-based system.
My goal is to allow users to specify rules in a syntax like this:
Code: Select all
(defrule "name of the rule"
:when (s-expression 1)
(s-expression 2)
...
(s-expression n)
:perform
(s-expresion 1)
(s-expression 2)
...
(s-expression m) )
First, is there an intelligent way to include the constant terms (:when and :perform) without adding them as specific parameters to the macro?
Second, How do I accept two chunks of unknown number of s-expressions without forcing the user to delimit all the lhs and rhs expressions in a list?
Although I have reviewed many codes with rule-based systems (CL-mycyn, Leibniz, Lisa, etc) the only problem seems to be my inexperience with macros and CL in general...
Any help will be greatly appreciated...
Thanks in advance...