cc4531cd1e
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@53 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
27 lines
297 B
Plaintext
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.
|