home *** CD-ROM | disk | FTP | other *** search
- (* first set up the author *)
-
- instanceof person a1;
-
- a1 := person.new("Lawrence");
- a1.set(1921,-1,"D. H. Lawrence");
-
- (* now set up the books *)
-
- instanceof book1 b1,b2;
-
- b1 := book1.new( "Lady Chatterly" );
-
- b1.set("Lady Chatterly",566,[1963],a1);
- b2 := book1.new( "Woman In Love" );
- b2.set("Woman In Love",343,[1968],a1);
-
- (* now show them. Notice the author is the same OBJECT thus when the *)
- (* author is declared dead, all references to the author reflect this *)
-
- b1.show();
- b2.show();
-
- a1.died(1977);
- b1.republished(1974);
-
- b1.show();
- b2.show();
-
- let instanceof person p := b1.get_author();
- p.show();
-