From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c0d427d5f4af20f8 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!z14g2000cwz.googlegroups.com!not-for-mail From: "REH" Newsgroups: comp.lang.ada Subject: Re: generics in Ada 83 Date: 13 Sep 2005 15:44:11 -0700 Organization: http://groups.google.com Message-ID: <1126651451.717028.253340@z14g2000cwz.googlegroups.com> References: <1126617980.932226.320710@g43g2000cwa.googlegroups.com> <1126637616.954302.85630@f14g2000cwb.googlegroups.com> NNTP-Posting-Host: 192.35.35.34 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1126651458 10109 127.0.0.1 (13 Sep 2005 22:44:18 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 13 Sep 2005 22:44:18 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: z14g2000cwz.googlegroups.com; posting-host=192.35.35.34; posting-account=lnUIyw0AAACoRB2fMF2SFTIilm8F10q2 Xref: g2news1.google.com comp.lang.ada:4637 Date: 2005-09-13T15:44:11-07:00 List-Id: Jeffrey Carter wrote: > Then you're in good shape. 1st, define your complete generic for using > the synchronous send feature: > > generic -- Client_Server_With_Synchronous_Send > type Header_Type is private; > > -- many formal subprograms > package Client_Server_With_Synchronous_Send is > procedure Op (Header : in out Header_Type); > > ... > end Client_Server_With_Synchronous_Send; > > then define your shorter generic: > > generic -- Client_Server > type Header_Type is private; > > with function Get_Length(Header : in Header_Type) return Integer; > > with procedure Set_Length(Header : in out Header_Type; > Length : in Integer); > package Client_Server is > -- presumably a smaller set of operations than > -- Client_Server_With_Synchronous_Send > procedure Op (Header : in out Header_Type); > > ... > end Client_Server; > > Now, the body of Client_Server instantiates > Client_Server_With_Synchronous_Send and implements its operations in > terms of Client_Server_With_Synchronous_Send's operations: > > with Client_Server_With_Synchronous_Send; > package body Client_Server is > -- Define stub subprograms for instantiation here. > > package Synchronous is new Client_Server_With_Synchronous_Send > (Header_Type => Header_Type, > Get_Length => Get_Length, > Set_Length => Set_Length, ...); > > procedure Op (Header : in out Header_Type) renames Synchronous.Op; > > ... > end Client_Server; > Thank you; much appreciated. REH