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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9aa4352fa83d37dc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-01 18:36:05 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!news.he.net!cyclone-sf.pbi.net!216.196.106.144!border2.nntp.sjc.giganews.com!border1.nntp.sjc.giganews.com!nntp.giganews.com!local1.nntp.sjc.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 01 Mar 2004 20:36:04 -0600 Date: Mon, 01 Mar 2004 21:36:03 -0500 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: library level required or not? References: <200403011717.22528.maa@liacc.up.pt> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.147.77.160 X-Trace: sv3-9flkNxVX2DEruoIxrNXSYkXodlPlH2EqHNmZWal1ko5B+T8G0VC5SbIBTA5JML+wJNd+7t9nsLL79WP!gu3jBb3g1W9Y7S8r0UnCNTHGmsA/2HeyUyyy1Xb2UFuYsFv4k/R25AxYUjrAcA== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:5997 Date: 2004-03-01T21:36:03-05:00 List-Id: Simon Wright wrote: > (I also see (4), "A type extension shall not be declared in a generic > body if the parent type is declared outside that body." I think ISNBAL > -- I shall never be a lawyer) This rule seems very mysterious, but it is actually a simple rule! Well, simple compared to the alternative. There are many weird things that you could do if this rule wasn't there. Rather than have a dozen exceptions to other rules, this one rule takes care of all of them. If you really need a type extension in a generic body, you can put the extension declaration in the private part of the package specification. This way (necessary) checks can be made at the point of any instantiation. If they succeed, fine. If not the instantiation is illegal. But the Ada model doesn't allow rejecting an instantiation because of declarations in the body of the generic. Extending a type declared in the generic body itself can never cause a problem because the legality of those declarations can't depend on the characteristics of a generic formal parameter. -- Robert I. Eachus "The only thing necessary for the triumph of evil is for good men to do nothing." --Edmund Burke