Logtalk 2.26.2 files.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1488 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
|
||||
:- object(instance1,
|
||||
instantiates(root)).
|
||||
|
||||
|
||||
:- end_object.
|
@@ -1,6 +0,0 @@
|
||||
|
||||
:- object(instance2,
|
||||
instantiates(root)).
|
||||
|
||||
|
||||
:- end_object.
|
@@ -1,6 +0,0 @@
|
||||
|
||||
:- object(instance3,
|
||||
instantiates(root)).
|
||||
|
||||
|
||||
:- end_object.
|
@@ -1,29 +0,0 @@
|
||||
|
||||
:- object(root,
|
||||
instantiates(root)).
|
||||
|
||||
|
||||
:- private(cv_/1).
|
||||
:- dynamic(cv_/1).
|
||||
:- mode(cv_(?integer), zero_or_one).
|
||||
|
||||
:- public(cv/1).
|
||||
:- mode(cv(?integer), zero_or_one).
|
||||
|
||||
:- public(set_cv/1).
|
||||
:- mode(set_cv(+integer), one).
|
||||
|
||||
|
||||
cv_(0). % cv value is stored locally, in this class
|
||||
|
||||
|
||||
cv(Value) :-
|
||||
cv_(Value). % retrive cv value, shared for all instances
|
||||
|
||||
|
||||
set_cv(Value) :-
|
||||
retractall(cv_(_)), % retract old cv value from this class
|
||||
asserta(cv_(Value)). % assert the new value in this class
|
||||
|
||||
|
||||
:- end_object.
|
Reference in New Issue
Block a user