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 9f1b358c04 Logtalk 2.26.2 files.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1486 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2005-12-24 18:00:21 +00:00

39 lines
624 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.