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 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: 14 Sep 2005 05:40:30 -0700 Organization: http://groups.google.com Message-ID: <1126701630.121261.157710@z14g2000cwz.googlegroups.com> References: <1126617980.932226.320710@g43g2000cwa.googlegroups.com> NNTP-Posting-Host: 192.35.35.35 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1126701635 14974 127.0.0.1 (14 Sep 2005 12:40:35 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 14 Sep 2005 12:40:35 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.6) Gecko/20040116,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: z14g2000cwz.googlegroups.com; posting-host=192.35.35.35; posting-account=lnUIyw0AAACoRB2fMF2SFTIilm8F10q2 Xref: g2news1.google.com comp.lang.ada:4656 Date: 2005-09-14T05:40:30-07:00 List-Id: Jean-Pierre Rosen wrote: > Jeffrey Carter a =E9crit : > > Defaults are defined for subprograms by inserting "is Name" or "is <>" > > before the semicolon (;): > > > > with procedure Y (Z : in X) is A; > > > > or > > > > with procedure Y (Z : in X) is <>; > > > > You can't use the former, since it requires a procedure A, visible at > > the point of the generic, that matches Y. Since you don't know what X is > > at the point of the generic, you can't have such a procedure. > > > Let me add something which is maybe not obvious to the OP: > In Ada, the legality of a generic is checked on the generic, not on the > instantiation. This is a main difference with templates. > > The benefit is that if a generic compiles, and the instantiation > provides parameters that match the contract (of the generic formals), > then the instantion is *always* OK. > Yes, thank you, I do know that. I'm just trying to find a way to shield the application programmers from dealing with noise they don't care about. I won't debate templates vs. generics. I see advantages to both, though I wil admit I prefer templates. REH