I have the following facts: (assert(name "Sara")) (assert(last_name "Jones"))
I would like to print them in a custom format by calling my function.
I have got this function (deffunction print-them () (bind ?n (find-fact ((?n name)) TRUE)) ) This function binds the found fact to a multi field variable ?n which prints like Fact-1, but I do not know how to print the details of the fact such as name is Sara and last_name is Jones. Would you be able to help me? Thanks.
You can reference the data inside an ordered (implied deftemplate) fact using the slot name implied. Alternately you can just use the ppfact function to print that data.