I think Mikael Rundqvist (ERA) wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] > Hi, > Jess version 60b3 > I have a question regarding the use of the retract and undefinstance: > > If I have created a fact through definstance is it supposed to work to use (retract ><definstanced fact-id>) > If I use this syntax I get TRUE back but the fact is still on the fact-list. >
(retract) always returns TRUE, so that's not too reassuring -- it should probably return something more informative. Anyway, retracting a shadow fact is the same as calling undefinstance on the Java Bean. Jess> (defclass button java.awt.Button) java.awt.Button Jess> (definstance button (new java.awt.Button)) <Fact-0> Jess> (facts) f-0 (MAIN::button (accessibleContext <External-Address:java.awt.Button$AccessibleAWTButton>) (actionCommand "") (background nil) (enabled TRUE) (font nil) (foreground nil) (label "") (name "button0") (visible TRUE) (OBJECT <External-Address:java.awt.Button>)) For a total of 1 facts. Jess> (retract (fact-id 0)) TRUE Jess> (facts) For a total of 0 facts. If you've got a case where this doesn't work, then either there's something wrong with your example, or there's a bug in Jess. If you can compose the smallest possible program that will let me reproduce the problem, I'll be glad to have a look at it. --------------------------------------------------------- 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] --------------------------------------------------------------------
