📄 instance.exp
字号:
TRUECLIPS> (batch "instance.bat")TRUECLIPS> (make-instance a of A)[a]CLIPS> (send [a] print)[a] of A(x 34)(y abc)CLIPS> (make-instance [a] of A (x 65))Old instance deleted.Slot x set with message.[a]CLIPS> (send [a] print)[a] of A(x 65)(y abc)CLIPS> (unmake-instance [a])Old instance deleted.TRUECLIPS> (make-instance b1 of BOGUS)New instance received init message.Slot a set by class.Slot b set by class.[b1]CLIPS> (make-instance b1 of BOGUS (b 45))Deleting old copy of instance.Slot b in instance set with put- message.New instance received init message.Slot a set by class.[b1]CLIPS> (send [b1] put-a 1)Slot a in instance set with put- message.1CLIPS> (send [b1] put-b 2)Slot b in instance set with put- message.2CLIPS> (send [b1] print)[b1] of BOGUS(a 1)(b 2)CLIPS> (initialize-instance [b1] (a xyz))Slot a in instance set with put- message.New instance received init message.Slot b set by class.[b1]CLIPS> (send [b1] print)[b1] of BOGUS(a xyz)(b def)CLIPS> (unmake-instance [b1])Deleting old copy of instance.TRUECLIPS> (make-instance b of B (z 0))[b]CLIPS> (send [b] print)[b] of B(x 34)(y 100)(z 0)CLIPS> (send [b] put-x 65)65CLIPS> (send [b] put-y abc)abcCLIPS> (send [b] put-z "Hello world.")"Hello world."CLIPS> (send [b] print)[b] of B(x 65)(y abc)(z "Hello world.")CLIPS> (initialize-instance b)[INSMNGR14] Override required for slot z in instance b.[PRCCODE4] Execution halted during the actions of message-handler init primary in class USER[INSMNGR8] An error occurred during the initialization of instance b.FALSECLIPS> (send [b] print)[b] of B(x 34)(y 100)(z "Hello world.")CLIPS> (unmake-instance b)TRUECLIPS> (watch instances)CLIPS> (reset)==> instance [initial-object] of INITIAL-OBJECT==> instance [c1] of C==> instance [gen1] of CCLIPS> (reset)<== instance [initial-object] of INITIAL-OBJECT<== instance [c1] of C<== instance [gen1] of C==> instance [initial-object] of INITIAL-OBJECT==> instance [c1] of C==> instance [gen2] of CCLIPS> (unwatch instances)CLIPS> (unmake-instance *)TRUECLIPS> (make-instance d of D)[d]CLIPS> (sym-cat (send [d] get-x) def)abcdefCLIPS> (send [d] put-x "New value.")"New value."CLIPS> (send [d] get-x)"New value."CLIPS> (unmake-instance *)TRUECLIPS> (make-instance z of Z)[z]CLIPS> (instances)[z] of ZFor a total of 1 instance.CLIPS> (unmake-instance *)TRUECLIPS> (unwatch all)CLIPS> (watch messages)CLIPS> (make-instance sv of SAVE-TEST (stamp 1))[MSGFUN1] No applicable primary message-handlers found for put-stamp.FALSECLIPS> (make-instance sv of SAVE-TEST)MSG >> init ED:1 (<Instance-sv>)MSG << init ED:1 (<Instance-sv>)[sv]CLIPS> (save-instances "ins.tmp")1CLIPS> (load-instances "ins.tmp")MSG >> delete ED:1 (<Instance-sv>)MSG << delete ED:1 (<Stale Instance-sv>)[MSGFUN1] No applicable primary message-handlers found for put-stamp.[INSFILE1] Function load-instances could not completely process file ins.tmp.0CLIPS> (instances)CLIPS> (restore-instances "ins.tmp")1CLIPS> (instances)[sv] of SAVE-TESTFor a total of 1 instance.CLIPS> (send [sv] print)MSG >> print ED:1 (<Instance-sv>)[sv] of SAVE-TEST(stamp 26959.7) ;; Different number is OKMSG << print ED:1 (<Instance-sv>)CLIPS> (dribble-off)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -