home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / ada / 2447 < prev    next >
Encoding:
Internet Message Format  |  1992-08-26  |  1.7 KB

  1. Path: sparky!uunet!stanford.edu!bcm!aio!dnsurber
  2. From: dnsurber@lescsse.jsc.nasa.gov (Douglas N. Surber)
  3. Newsgroups: comp.lang.ada
  4. Subject: Re: Another Question about protected records
  5. Message-ID: <dnsurber.714854723@node_26400>
  6. Date: 26 Aug 1992 18:45:23 GMT
  7. References: <1992Aug19.222949.12391@seas.gwu.edu> <1992Aug25.175331.26911@inmet.camb.inmet.com>
  8. Sender: news@aio.jsc.nasa.gov (USENET News System)
  9. Organization: Lockheed Engineering and Sciences
  10. Lines: 53
  11.  
  12. In <1992Aug25.175331.26911@inmet.camb.inmet.com> stt@spock.camb.inmet.com (Tucker Taft) writes:
  13.  
  14. >In any case, we are currently considering dropping the reserved
  15. >word "record" completely from the syntax (and name) for protected types,
  16. >so that the new syntax would be :
  17.  
  18. >   protected [type] identifier[discriminant_part] is
  19. >     {protected_operation_declaration}
  20. >   private
  21. >     {protected_item}
  22. >   end [identifier];
  23.  
  24. >where protected_item is either a protected_operation_declaration
  25. >or a component_declaration.
  26.  
  27. Why the special case syntax for for a protected type? IMHO it would be
  28. more economical to use the existing type specification syntax with the
  29. addition of protected_type_definition as an alternative.
  30.  
  31.     type_definition ::=
  32.         . . . as in Ada83
  33.         | protected_type_definition
  34.  
  35.     protected_type_definition ::=
  36.     protected identifier[discriminant_part] is
  37.       {protected_operation_declaration}
  38.     private
  39.       {protected_item}
  40.     end [identifier];
  41.  
  42. Thus a protected type would be defined as
  43.  
  44.     type Prot is
  45.       protected
  46.     ...
  47.       private
  48.     ...
  49.       end Prot;
  50.  
  51. and a protected object would be
  52.  
  53.     Prot_Obj :
  54.       protected
  55.     ...
  56.       private
  57.     ...
  58.       end Prot_Obj;
  59.  
  60. I don't see the need for a new basic_declaration production. Just my two cents.
  61.  
  62. Douglas Surber
  63. Lockheed
  64. Houston, TX
  65.