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/viewpoints/joeEmployee.lgt
2001-06-06 19:40:57 +00:00

27 lines
297 B
Plaintext

:- object(joeEmployee,
extends(joePerson)).
:- public(worksFor/1).
:- public(salary/1).
:- dynamic(salary/1).
:- public(giveRaise/1).
worksFor('ToonTown').
salary(1500).
giveRaise(Raise) :-
retract(salary(Old)),
New is Old + Raise,
asserta(salary(New)).
:- end_object.