As a workaround, you can use a lambda for smuggling the list into the query:
(bind ?eq-pqr (lambda (?arg) (return (eq (list p q r) ?arg))) )
(defquery q1
(declare (variables ?pa ?lam))
(myfact (a ?pa) (b ?b) (c $?v :(?lam $?v))
)
)
-W
On Fri, Nov 13, 2009 at 7:04 PM, Ernest Friedman-Hill
Given this deffunction:
(deffunction list2lambda ($?list)
(return (eval (str-cat (lambda (?arg) (return (eq (list
(implode$ $?list)
) ?arg)))
the run-query* call could even be written as simply as
(run-query* q1 1 (list2lambda p q r
That is *really* clever. Sweet!
On Nov 16, 2009, at 10:59 AM, Wolfgang Laun wrote:
Given this deffunction:
(deffunction list2lambda ($?list)
(return (eval (str-cat (lambda (?arg) (return (eq (list
(implode$ $?list)
) ?arg)))
the
Hmmm. Indeed, you're right, and it's a limitation of the
implementation, not easily lifted. I'll add it to the issues list.
On Nov 13, 2009, at 12:20 PM, Michael Welter wrote:
Can't a list be passed to defquery?
(deftemplate myfact
(slot a)
(slot b)
(multislot c)
)
(deffacts f1