This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/Logtalk/examples/benchmarks/database.lgt
pmoura 8b74eb8b2b Logtalk 2.23.1 files.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1260 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2005-03-06 21:19:09 +00:00

41 lines
626 B
Plaintext

:- object(database).
:- public(db_test_this/0, db_test_self/0, db_test_obj/0).
:- private(pred_this/0, pred_self/0, pred_obj/0).
:- dynamic(pred_this/0, pred_self/0, pred_obj/0).
db_test_this :-
{repeat(100)},
assertz(pred_this),
fail.
db_test_this :-
retract(pred_this),
fail.
db_test_this.
db_test_self :-
{repeat(100)},
::assertz(pred_self),
fail.
db_test_self :-
::retract(pred_self),
fail.
db_test_self.
db_test_obj :-
this(This),
{repeat(100)},
This::assertz(pred_obj),
fail.
db_test_obj :-
this(This),
This::retract(pred_obj),
fail.
db_test_obj.
:- end_object.