TRUE CLIPS> (batch "coolcmd.bat") TRUE CLIPS> (defclass PP-TEST (is-a USER) (multislot x) (slot y)) CLIPS> (ppdefclass) [ARGACCES1] Function 'ppdefclass' expected at least 1 argument. CLIPS> (ppdefclass USER) CLIPS> (ppdefclass BOGUS) [PRNTUTIL1] Unable to find defclass 'BOGUS'. CLIPS> (ppdefclass PP-TEST) (defclass MAIN::PP-TEST (is-a USER) (multislot x) (slot y)) CLIPS> (ppdefclass PP-TEST stdout) (defclass MAIN::PP-TEST (is-a USER) (multislot x) (slot y)) CLIPS> (ppdefclass PP-TEST bogus) [ROUTER1] Logical name 'bogus' was not recognized by any routers. CLIPS> (ppdefclass PP-TEST nil) "(defclass MAIN::PP-TEST (is-a USER) (multislot x) (slot y)) " CLIPS> (list-defclasses) FLOAT INTEGER SYMBOL STRING MULTIFIELD EXTERNAL-ADDRESS FACT-ADDRESS INSTANCE-ADDRESS INSTANCE-NAME OBJECT PRIMITIVE NUMBER LEXEME ADDRESS INSTANCE USER PP-TEST For a total of 17 defclasses. CLIPS> (defclass TEST (is-a USER) (role concrete)) CLIPS> (defclass ANOTHER-TEST (is-a TEST)) CLIPS> (defclass * (is-a OBJECT)) CLIPS> (undefclass BOGUS) [PRNTUTIL1] Unable to find defclass 'BOGUS'. CLIPS> (undefclass *) CLIPS> (undefclass OBJECT) [PRNTUTIL4] Unable to delete defclass 'OBJECT'. CLIPS> (undefclass PRIMITIVE) [PRNTUTIL4] Unable to delete defclass 'PRIMITIVE'. CLIPS> (undefclass MULTIFIELD) [PRNTUTIL4] Unable to delete defclass 'MULTIFIELD'. CLIPS> (undefclass EXTERNAL-ADDRESS) [PRNTUTIL4] Unable to delete defclass 'EXTERNAL-ADDRESS'. CLIPS> (undefclass NUMBER) [PRNTUTIL4] Unable to delete defclass 'NUMBER'. CLIPS> (undefclass LEXEME) [PRNTUTIL4] Unable to delete defclass 'LEXEME'. CLIPS> (undefclass INTEGER) [PRNTUTIL4] Unable to delete defclass 'INTEGER'. CLIPS> (undefclass FLOAT) [PRNTUTIL4] Unable to delete defclass 'FLOAT'. CLIPS> (undefclass SYMBOL) [PRNTUTIL4] Unable to delete defclass 'SYMBOL'. CLIPS> (undefclass STRING) [PRNTUTIL4] Unable to delete defclass 'STRING'. CLIPS> (make-instance t of TEST) [t] CLIPS> (undefclass TEST) [PRNTUTIL4] Unable to delete defclass 'TEST'. CLIPS> (unmake-instance *) TRUE CLIPS> (defmethod foo ((?a TEST))) CLIPS> (undefclass TEST) [PRNTUTIL4] Unable to delete defclass 'TEST'. CLIPS> (undefgeneric foo) CLIPS> (undefclass TEST) CLIPS> (list-defclasses) FLOAT INTEGER SYMBOL STRING MULTIFIELD EXTERNAL-ADDRESS FACT-ADDRESS INSTANCE-ADDRESS INSTANCE-NAME OBJECT PRIMITIVE NUMBER LEXEME ADDRESS INSTANCE USER PP-TEST For a total of 17 defclasses. CLIPS> (undefclass *) CLIPS> (list-defclasses) FLOAT INTEGER SYMBOL STRING MULTIFIELD EXTERNAL-ADDRESS FACT-ADDRESS INSTANCE-ADDRESS INSTANCE-NAME OBJECT PRIMITIVE NUMBER LEXEME ADDRESS INSTANCE USER For a total of 16 defclasses. CLIPS> (defclass CHILD (is-a USER) (role abstract) (slot age (create-accessor ?NONE)) (slot sex (access read-only) (storage shared) (create-accessor ?NONE))) CLIPS> (defclass BOY (is-a CHILD) (role concrete) (slot sex (source composite) (default male) (create-accessor ?NONE))) CLIPS> (defmessage-handler BOY play () (printout t "The boy is now playing..." crlf)) CLIPS> (describe-class CHILD) ================================================================================ ******************************************************************************** Abstract: direct instances of this class cannot be created. Direct Superclasses: USER Inheritance Precedence: CHILD USER OBJECT Direct Subclasses: BOY -------------------------------------------------------------------------------- SLOTS : FLD DEF PRP ACC STO MCH SRC VIS CRT OVRD-MSG SOURCE(S) age : SGL STC INH RW LCL RCT EXC PRV NIL put-age CHILD sex : SGL STC INH R SHR RCT EXC PRV NIL NIL CHILD Constraint information for slots: SLOTS : SYM STR INN INA EXA FTA INT FLT age : + + + + + + + + RNG:[-oo..+oo] sex : + + + + + + + + RNG:[-oo..+oo] -------------------------------------------------------------------------------- Recognized message-handlers: init primary in class USER delete primary in class USER create primary in class USER print primary in class USER direct-modify primary in class USER message-modify primary in class USER direct-duplicate primary in class USER message-duplicate primary in class USER ******************************************************************************** ================================================================================ CLIPS> (describe-class BOY) ================================================================================ ******************************************************************************** Concrete: direct instances of this class can be created. Non-reactive: direct instances of this class cannot match defrule patterns. Direct Superclasses: CHILD Inheritance Precedence: BOY CHILD USER OBJECT Direct Subclasses: -------------------------------------------------------------------------------- SLOTS : FLD DEF PRP ACC STO MCH SRC VIS CRT OVRD-MSG SOURCE(S) age : SGL STC INH RW LCL RCT EXC PRV NIL put-age CHILD sex : SGL STC INH R SHR RCT CMP PRV NIL NIL CHILD BOY Constraint information for slots: SLOTS : SYM STR INN INA EXA FTA INT FLT age : + + + + + + + + RNG:[-oo..+oo] sex : + + + + + + + + RNG:[-oo..+oo] -------------------------------------------------------------------------------- Recognized message-handlers: init primary in class USER delete primary in class USER create primary in class USER print primary in class USER direct-modify primary in class USER message-modify primary in class USER direct-duplicate primary in class USER message-duplicate primary in class USER play primary in class BOY ******************************************************************************** ================================================================================ CLIPS> (defclass a (is-a USER)) CLIPS> (defclass b (is-a USER)) CLIPS> (defclass c (is-a a b)) CLIPS> (defclass d (is-a USER)) CLIPS> (defclass e (is-a c d)) CLIPS> (defclass f (is-a e)) CLIPS> (browse-classes) OBJECT PRIMITIVE NUMBER INTEGER FLOAT LEXEME SYMBOL STRING MULTIFIELD ADDRESS EXTERNAL-ADDRESS FACT-ADDRESS INSTANCE-ADDRESS * INSTANCE INSTANCE-ADDRESS * INSTANCE-NAME USER CHILD BOY a c * e * f b c * e * f d e * f CLIPS> (browse-classes a) a c * e * f CLIPS> (browse-classes BOGUS) [CLASSFUN1] Unable to find class 'BOGUS' in function 'browse-classes'. CLIPS> (browse-classes 34) [ARGACCES2] Function 'browse-classes' expected argument #1 to be of type symbol. CLIPS> (ppdefmessage-handler) [ARGACCES1] Function 'ppdefmessage-handler' expected at least 2 arguments. CLIPS> (ppdefmessage-handler bogus) [ARGACCES1] Function 'ppdefmessage-handler' expected at least 2 arguments. CLIPS> (ppdefmessage-handler bogus bogus) [MSGCOM2] Unable to find message-handler 'bogus' primary for class 'bogus' in function 'ppdefmessage-handler'. CLIPS> (ppdefmessage-handler USER bogus) [MSGCOM2] Unable to find message-handler 'bogus' primary for class 'USER' in function 'ppdefmessage-handler'. CLIPS> (ppdefmessage-handler bogus init) [MSGCOM2] Unable to find message-handler 'init' primary for class 'bogus' in function 'ppdefmessage-handler'. CLIPS> (ppdefmessage-handler USER init) CLIPS> (ppdefmessage-handler BOY play) (defmessage-handler MAIN::BOY play () (printout t "The boy is now playing..." crlf)) CLIPS> (ppdefmessage-handler BOY play primary) (defmessage-handler MAIN::BOY play () (printout t "The boy is now playing..." crlf)) CLIPS> (ppdefmessage-handler BOY play primary stdout) (defmessage-handler MAIN::BOY play () (printout t "The boy is now playing..." crlf)) CLIPS> (ppdefmessage-handler BOY play primary bogus) [ROUTER1] Logical name 'bogus' was not recognized by any routers. CLIPS> (ppdefmessage-handler BOY play primary nil) "(defmessage-handler MAIN::BOY play () (printout t "The boy is now playing..." crlf)) " CLIPS> (ppdefmessage-handler USER init around) [MSGCOM2] Unable to find message-handler 'init' around for class 'USER' in function 'ppdefmessage-handler'. CLIPS> (ppdefmessage-handler USER init before) [MSGCOM2] Unable to find message-handler 'init' before for class 'USER' in function 'ppdefmessage-handler'. CLIPS> (ppdefmessage-handler USER init after) [MSGCOM2] Unable to find message-handler 'init' after for class 'USER' in function 'ppdefmessage-handler'. CLIPS> (defmessage-handler BOY init after ()) CLIPS> (list-defmessage-handlers) init primary in class USER delete primary in class USER create primary in class USER print primary in class USER direct-modify primary in class USER message-modify primary in class USER direct-duplicate primary in class USER message-duplicate primary in class USER play primary in class BOY init after in class BOY For a total of 10 message-handlers. CLIPS> (list-defmessage-handlers *) [CLASSFUN1] Unable to find class '*' in function 'list-defmessage-handlers'. CLIPS> (defclass * (is-a USER)) CLIPS> (list-defmessage-handlers) init primary in class USER delete primary in class USER create primary in class USER print primary in class USER direct-modify primary in class USER message-modify primary in class USER direct-duplicate primary in class USER message-duplicate primary in class USER play primary in class BOY init after in class BOY For a total of 10 message-handlers. CLIPS> (undefclass *) CLIPS> (list-defmessage-handlers USER) init primary in class USER delete primary in class USER create primary in class USER print primary in class USER direct-modify primary in class USER message-modify primary in class USER direct-duplicate primary in class USER message-duplicate primary in class USER For a total of 8 message-handlers. CLIPS> (defmessage-handler USER * ()) CLIPS> (defmessage-handler USER bogus ()) CLIPS> (list-defmessage-handlers USER) init primary in class USER delete primary in class USER create primary in class USER print primary in class USER direct-modify primary in class USER message-modify primary in class USER direct-duplicate primary in class USER message-duplicate primary in class USER * primary in class USER bogus primary in class USER For a total of 10 message-handlers. CLIPS> (undefmessage-handler USER *) CLIPS> (list-defmessage-handlers USER) init primary in class USER delete primary in class USER create primary in class USER print primary in class USER direct-modify primary in class USER message-modify primary in class USER direct-duplicate primary in class USER message-duplicate primary in class USER bogus primary in class USER For a total of 9 message-handlers. CLIPS> (undefmessage-handler) [ARGACCES1] Function 'undefmessage-handler' expected at least 2 arguments. CLIPS> (undefmessage-handler * *) CLIPS> (list-defmessage-handlers) init primary in class USER delete primary in class USER create primary in class USER print primary in class USER direct-modify primary in class USER message-modify primary in class USER direct-duplicate primary in class USER message-duplicate primary in class USER init after in class BOY For a total of 9 message-handlers. CLIPS> (undefmessage-handler * * *) CLIPS> (list-defmessage-handlers) init primary in class USER delete primary in class USER create primary in class USER print primary in class USER direct-modify primary in class USER message-modify primary in class USER direct-duplicate primary in class USER message-duplicate primary in class USER For a total of 8 message-handlers. CLIPS> (clear) CLIPS> (defmessage-handler USER my-message around ()) CLIPS> (defmessage-handler USER my-message before ()) CLIPS> (defmessage-handler USER my-message ()) CLIPS> (defmessage-handler USER my-message after ()) CLIPS> (defmessage-handler OBJECT my-message around ()) CLIPS> (defmessage-handler OBJECT my-message before ()) CLIPS> (defmessage-handler OBJECT my-message primary ()) CLIPS> (defmessage-handler OBJECT my-message after ()) CLIPS> (preview-send) [ARGACCES1] Function 'preview-send' expected exactly 2 arguments. CLIPS> (preview-send BOGUS blah) [CLASSFUN1] Unable to find class 'BOGUS' in function 'preview-send'. CLIPS> (preview-send USER blah) [MSGFUN1] No applicable primary message-handlers found for 'blah'. CLIPS> (preview-send USER my-message) >> my-message around in class USER | >> my-message around in class OBJECT | | >> my-message before in class USER | | << my-message before in class USER | | >> my-message before in class OBJECT | | << my-message before in class OBJECT | | >> my-message primary in class USER | | | >> my-message primary in class OBJECT | | | << my-message primary in class OBJECT | | << my-message primary in class USER | | >> my-message after in class OBJECT | | << my-message after in class OBJECT | | >> my-message after in class USER | | << my-message after in class USER | << my-message around in class OBJECT << my-message around in class USER CLIPS> (preview-send OBJECT my-message) >> my-message around in class OBJECT | >> my-message before in class OBJECT | << my-message before in class OBJECT | >> my-message primary in class OBJECT | << my-message primary in class OBJECT | >> my-message after in class OBJECT | << my-message after in class OBJECT << my-message around in class OBJECT CLIPS> (clear) CLIPS> (defclass TEST (is-a USER) (role concrete) (slot x (create-accessor write)) (multislot y (default ?NONE) (create-accessor write)) (slot z (create-accessor write))) CLIPS> (definstances TEST-CASES "Random comment..." (t1 of TEST (x 100) (y a b c d e f)) (t2 of TEST (y blah))) CLIPS> (ppdefinstances) [ARGACCES1] Function 'ppdefinstances' expected at least 1 argument. CLIPS> (ppdefinstances BOGUS) [PRNTUTIL1] Unable to find definstances 'BOGUS'. CLIPS> (ppdefinstances 34) [ARGACCES2] Function 'ppdefinstances' expected argument #1 to be of type symbol. CLIPS> (ppdefinstances TEST-CASES) (definstances MAIN::TEST-CASES "Random comment..." (t1 of TEST (x 100) (y a b c d e f)) (t2 of TEST (y blah))) CLIPS> (ppdefinstances TEST-CASES stdout) (definstances MAIN::TEST-CASES "Random comment..." (t1 of TEST (x 100) (y a b c d e f)) (t2 of TEST (y blah))) CLIPS> (ppdefinstances TEST-CASES bogus) [ROUTER1] Logical name 'bogus' was not recognized by any routers. CLIPS> (ppdefinstances TEST-CASES nil) "(definstances MAIN::TEST-CASES "Random comment..." (t1 of TEST (x 100) (y a b c d e f)) (t2 of TEST (y blah))) " CLIPS> (list-definstances) TEST-CASES For a total of 1 definstances. CLIPS> (reset) CLIPS> (instances) [t1] of TEST [t2] of TEST For a total of 2 instances. CLIPS> (instances MAIN TEST) [t1] of TEST [t2] of TEST For a total of 2 instances. CLIPS> (instances MAIN USER) CLIPS> (instances MAIN USER inherit) [t1] of TEST [t2] of TEST For a total of 2 instances. CLIPS> (instances MAIN BOGUS) [CLASSFUN1] Unable to find class 'BOGUS' in function 'instances'. CLIPS> (instances MAIN USER junk) [ARGACCES2] Function 'instances' expected argument #3 to be of type keyword "inherit". CLIPS> (send [t1] print) [t1] of TEST (x 100) (y a b c d e f) (z nil) CLIPS> (defmessage-handler TEST print () (printout t "Printing twice..." crlf) (ppinstance) (call-next-handler) (printout t "Done!" crlf)) CLIPS> (send [t2] print) Printing twice... [t2] of TEST (x nil) (y blah) (z nil) [t2] of TEST (x nil) (y blah) (z nil) Done! CLIPS> (undefinstances) [ARGACCES1] Function 'undefinstances' expected exactly 1 argument. CLIPS> (definstances * (t3 of TEST)) CLIPS> (undefinstances *) CLIPS> (list-definstances) TEST-CASES For a total of 1 definstances. CLIPS> (undefinstances *) CLIPS> (list-definstances) CLIPS> (load-instances) [ARGACCES1] Function 'load-instances' expected exactly 1 argument. CLIPS> (load-instances 34) [ARGACCES2] Function 'load-instances' expected argument #1 to be of type symbol or string. CLIPS> (load-instances "coolcmd.bat") [PRNTUTIL2] Syntax Error: Check appropriate syntax for make-instance. [INSFILE1] Function 'load-instances' could not completely process file 'coolcmd.bat'. 0 CLIPS> (save-instances) [ARGACCES1] Function 'save-instances' expected at least 1 argument. CLIPS> (save-instances 34) [ARGACCES2] Function 'save-instances' expected argument #1 to be of type symbol or string. CLIPS> (send [t2] put-z (instance-address t1)) CLIPS> (slot-replace$ t1 y 2 2 (instance-address t2)) (a c d e f) CLIPS> (save-instances "Actual//coolcmd2.out") 2 CLIPS> (reset) CLIPS> (load-instances "Actual//coolcmd2.out") 2 CLIPS> (restore-instances "Actual//coolcmd2.out") 2 CLIPS> (do-for-all-instances ((?a OBJECT)) TRUE (send ?a print)) Printing twice... [t1] of TEST (x 100) (y a [t2] c d e f) (z nil) [t1] of TEST (x 100) (y a [t2] c d e f) (z nil) Done! Printing twice... [t2] of TEST (x nil) (y blah) (z [t1]) [t2] of TEST (x nil) (y blah) (z [t1]) Done! CLIPS> (dribble-off)