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/threads/birthdays/SCRIPT.txt
pmoura 46c8cfbeff Logtalk 2.29.4 files.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1799 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-02-19 18:58:28 +00:00

47 lines
746 B
Plaintext

=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.29.4
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
=================================================================
% load the example:
| ?- logtalk_load(birthdays(loader)).
...
% create two new agents, Paul and Nathalie:
| ?- agent::(new(paul, 40, male), new(nathalie, 32, female)).
Yes
% make them friends:
| ?- paul::new_friend(nathalie).
Yes
% it's birthday for Nathalie:
| ?- nathalie::birthday.
Happy birthday from paul!
Thanks! Here, have a slice of cake, paul.
Thanks for the cake nathalie!
Yes
% tell Paul to ask Nathalie her age:
| ?- paul::ask_age(nathalie, Age).
Age = 33
Yes