home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / ada / 4112 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.1 KB  |  47 lines

  1. Newsgroups: comp.lang.ada
  2. Path: sparky!uunet!scifi!acheron!philabs!linus!linus.mitre.org!linus!mbunix!emery
  3. From: emery@goldfinger.mitre.org (David Emery)
  4. Subject: Re: private types and recompilation
  5. In-Reply-To: erickson@taurus.cs.nps.navy.mil's message of 27 Jan 93 22:15:35 GMT
  6. Message-ID: <EMERY.93Jan28091329@goldfinger.mitre.org>
  7. Sender: news@linus.mitre.org (News Service)
  8. Nntp-Posting-Host: goldfinger.mitre.org
  9. Organization: The Mitre Corp., Bedford, MA.
  10. References: <7277@grus.cs.nps.navy.mil>
  11. Date: Thu, 28 Jan 1993 14:13:29 GMT
  12. Lines: 33
  13.  
  14. In this particular situation, Ada can do what you want.  You can
  15. complete an incomplete type in the package body.  So, given:
  16.  
  17.     private
  18.       type LIST;
  19.       type POSITION is access LIST;
  20.       type LIST is record
  21.         A: ATOM;
  22.         NEXT: POSITION;
  23.       end record;
  24.     end LIST_ADT;
  25.  
  26. you can do the following:
  27.  
  28.     private
  29.       type LIST;
  30.       type POSITION is access LIST;
  31.     end LIST_ADT;
  32.  
  33.     package body LIST_ADT is
  34.  
  35.       type LIST is record
  36.         A: ATOM;
  37.         NEXT: POSITION;
  38.       end record;
  39.  
  40.     ...
  41.     end LIST_ADT;
  42.  
  43. (Thanks to Tucker Taft who argued for this feature in Ada 83.)
  44.  
  45.                 dave
  46.  
  47.