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/lpa/timetables/subjects.lgt

83 lines
1.3 KiB
Plaintext
Raw Normal View History

:- object(subjects).
:- info([
version is 1.0,
date is 2005/5/8,
author is 'Example by LPA; adapted to Logtalk by Paulo Moura.',
comment is 'General attributes & methods for all subjects.']).
:- public(print/0).
:- info(print/0, [
comment is 'Print complete timetable from the subject viewpoint.']).
print :-
nl, write('SUBJECT TIMETABLE ...'), nl, nl,
forall(extends_object(Subject, subject), Subject::print),
nl.
:- end_object.
:- object(subject).
:- info([
version is 1.0,
date is 2005/5/8,
author is 'Example by LPA; adapted to Logtalk by Paulo Moura.',
comment is 'General attributes & methods for all subjects.']).
:- public(print/0).
:- info(print/0, [
comment is 'Print complete timetable from the subject viewpoint.']).
print :-
self(Self),
write('SUBJECT: '), write(Self), nl,
forall(extends_object(Period, period), Period::print_subject(Self)),
nl.
:- end_object.
:- object(maths,
extends(subject)).
:- end_object.
:- object(music,
extends(subject)).
:- end_object.
:- object(french,
extends(subject)).
:- end_object.
:- object(prolog,
extends(subject)).
:- end_object.
:- object(biology,
extends(subject)).
:- end_object.
:- object('prolog++',
extends(subject)).
:- end_object.
:- object(accountancy,
extends(subject)).
:- end_object.