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!news2.google.com!newsread.com!news-xfer.newsread.com!newspeer.monmouth.com!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: generics in Ada 83 Date: Wed, 14 Sep 2005 10:14:41 +0200 Organization: Adalog Message-ID: References: <1126617980.932226.320710@g43g2000cwa.googlegroups.com> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1126688476 2148 195.25.228.57 (14 Sep 2005 09:01:16 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Wed, 14 Sep 2005 09:01:16 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: fr, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:4649 Date: 2005-09-14T10:14:41+02:00 List-Id: Jeffrey Carter a �crit : > 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. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr