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/roots/prototypes.lgt
pmoura d79dd807e6 Logtalk 2.29.1 files.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1744 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-12-28 13:03:34 +00:00

63 lines
1.2 KiB
Plaintext

:- protocol(protop).
:- info([
version is 1.0,
date is 2000/7/24,
author is 'Paulo Moura',
comment is 'Default protocol for all prototypes.']).
:- public(clone/1).
:- mode(clone(?object), zero_or_one).
:- info(clone/1, [
comment is 'Clones a prototype.',
argnames is ['Clone']]).
:- public(print/0).
:- mode(print, one).
:- info(print/0, [
comment is 'Pretty prints an object description.']).
:- end_protocol.
:- object(proto,
implements(protop, monitoring),
imports(initialization, proto_hierarchy)).
:- info([
version is 1.2,
date is 2006/12/14,
author is 'Paulo Moura',
comment is 'Minimal predicates for all prototypes. Default root of the extension graph.']).
:- uses(event_registry, [del_monitors/4]).
clone(Clone) :-
self(Self),
sender(Sender),
throw(error(descendant_responsability, Self::clone(Clone), Sender)).
default_free_option(del_monitors).
process_free_option(del_monitors) :-
self(Self),
del_monitors(Self, _, _, _),
del_monitors(_, _, Self, _),
del_monitors(_, _, _, Self).
print :-
self(Self),
writeq(Self), nl, nl,
forall(
::current_predicate(Predicate),
(writeq(Predicate), nl)),
nl.
before(_, _, _).
after(_, _, _).
:- end_object.