home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / language / grs / g / Book3 < prev    next >
Encoding:
Text File  |  1991-04-14  |  611 b   |  32 lines

  1. (* first set up the author *)
  2.  
  3. instanceof person a1;
  4.  
  5. a1 := person.new("Lawrence");
  6. a1.set(1921,-1,"D. H. Lawrence");
  7.  
  8. (* now set up the books *)
  9.  
  10. instanceof book1 b1,b2;
  11.  
  12. b1 := book1.new( "Lady Chatterly" );
  13.  
  14. b1.set("Lady Chatterly",566,[1963],a1);
  15. b2 := book1.new( "Woman In Love" );
  16. b2.set("Woman In Love",343,[1968],a1);
  17.  
  18. (* now show them.  Notice the author is the same OBJECT thus when the *)
  19. (* author is declared dead, all references to the author reflect this *)
  20.  
  21. b1.show();
  22. b2.show();
  23.  
  24. a1.died(1977);
  25. b1.republished(1974);
  26.  
  27. b1.show();
  28. b2.show();
  29.  
  30. let instanceof person p := b1.get_author();
  31. p.show();
  32.