Hi,

I'm new to Jess and CLIPS so I'm working my way through Giarratano's
CLIPS user guide.

I can do all his early examples in Java, ie assertFact, retract, reset,
clear etc. I do have problems however with the duck / quack example :)

// this seems to work OK
r.assertFact (new Fact ("animal-is duck", r));

// I then add the rule
cmd = " (defrule duck (animal-is duck) " +
   " => (assert (sound-is quack)) )";
System.out.println ( r.executeCommand (cmd));
  
// but this then fails (ie returns 0)
System.out.println ("r.run = " +  r.run ());


However, if I use executeCommand (assert...) then everything works OK:

// start with this instead of assertFact and it works!
cmd = " (assert (animal-is duck)) ";
System.out.println ( r.executeCommand (cmd));


Any ideas? Is there some default slot value not getting assigned?

TIA,

John





--------------------------------------------------------------------
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]
--------------------------------------------------------------------

Reply via email to