Closed alexey-martynov closed 11 years ago
Is the following solution feasible for you?
(defrule alternative-1
...
(:destructure (...)
(list 1 ACTUAL-RESULT)))
(defrule alternative-2
...
(:destructure (...)
(list 2 ACTUAL-RESULT)))
(defrule dynamically-generated
(or alternative-1 alternative-2 ...)
(:destructure (alternative &rest result)
(case alternative
(1 ...)
(2 ...)
...)))
No, it can't solve my problem because contents of the OR statement are updated at runtime and contents of the added rules are came from client part. I don't like an idea to parse supplied contents and update them.
Also, problem was introduced by the way of interpretation of the rule symbol if DEFRULE. I can't supply dynamically generated symbol as rule symbol because it simply inserted to the statement.
:AROUND rule has solved my problem.
We have dynamically generated contents of OR rule. For proper functioning we need to know inside :DESTRUCTURE what symbol inside OR is matched.