home *** CD-ROM | disk | FTP | other *** search
- instanceof class book1;
-
- book1 := class.new(
- "book1",
- [
- {
- null function set( string s; integer i;
- listof integer l; instanceof person p )
- {
- assume string title;
- listof integer publication_dates;
- integer number_of_pages;
- instanceof person author in
- {
- title := s;
- publication_dates := l;
- number_of_pages := i;
- author := p;
- };
- };
- },
- {
- null function show()
- {
- assume string title;
- listof integer publication_dates;
- integer number_of_pages;
- instanceof person author in
- {
- write("\nBook : ",title,"\n");
- write("published in : ");
- foreach i in publication_dates do
- write(i," ");
- write("\nno of pages : ",number_of_pages,"\n\n");
- write("Author :\n");
- author.show();
- };
- };
- },
- {
- instanceof person function get_author()
- {
- assume instanceof person author in
- return author;
- };
- },
- {
- null function republished( integer date )
- {
- assume listof integer publication_dates in
- publication_dates := publication_dates + [date];
- };
- }
- ],
- [
- {
- string title;
- listof integer publication_dates;
- integer number_of_pages;
- instanceof person author;
- }
- ]
- );
-
-