I think Vincent Wolowski wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] > Thanks a lot for your advice and the improvement of my code. > > I used deftemplate and deffacts: > > (deftemplate productoffer > (slot product1) > (slot product2) > (slot product3)) > > (deffacts productvalue > (productoffer (product1 A) (product2 B) (product3 C))) > > I have the following question: > Is it right, to get each slot value in Jess, the only way is to use fact-slot-value >- foreach and nth$ are used for multifields? >
Yes, that's right. You can't iterate over a fact's slots from Jess using Jess-language functions. You could, though, if you knew what you're doing, use the Fact's Java API from Jess; Jess> (bind ?f (assert (foo a b c))) <Fact-0> Jess> (?f get 0) (a b c) Jess> (fact-slot-value ?f __data) (a b c) > Vincent > --------------------------------------------------------- Ernest Friedman-Hill Distributed Systems Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 Org. 8920, MS 9012 [EMAIL PROTECTED] PO Box 969 http://herzberg.ca.sandia.gov Livermore, CA 94550 -------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] --------------------------------------------------------------------
