Closed ThomasDeutsch closed 9 years ago
datascript can not (= (fncall ...) (fncall ...)) and needs two pattern variables instead
You’re right, that’s the limitation of Datalog. You can introduce new variables in rule as well:
(def filter-rule
'[[(fits ?t1 ?t2 ?first ?last)
[(?last ?t1) ?x]
[(?first ?t2) ?y]
[(= ?x ?y)]]])
For this example, a simple rule is not working, and i do not know why. At first the working example, and then the same task with a rule.
Example: The last from the first task-list matches the first from the second task-list. For this Example [1 2 3] [3 4 5] is valid and [3 4 5] [1 2 3] is not.
Same thing, as a rule:
it seems to ignore the rule - what is my mistake?
Is it because datascript can not (= (fncall ...) (fncall ...)) and needs two pattern variables instead?