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: a07f3367d7,556e5b18154df788 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.224.172.200 with SMTP id m8mr3531989qaz.0.1365343646683; Sun, 07 Apr 2013 07:07:26 -0700 (PDT) MIME-Version: 1.0 Path: ef9ni13677qab.0!nntp.google.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!backlog2.nntp.ams.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!feeder1.cambriumusenet.nl!82.197.223.103.MISMATCH!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!news.n-ix.net!news.hufnagl.info!fu-berlin.de!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Interresting, possibly buggy behavior in GNAT generics w/ expression function. Date: Tue, 2 Apr 2013 16:59:12 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <1k6ipbtagwzw4$.1dv47rfygcedg.dlg@40tude.net> <1ex3dm2hk2j54$.1uiyljwziv0hi$.dlg@40tude.net> <1ilubaaaex6jp$.zd9lslst85nn.dlg@40tude.net> <1nrmzafa783kj.bcm8e5qfiiqi.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1364939954 3368 69.95.181.76 (2 Apr 2013 21:59:14 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 2 Apr 2013 21:59:14 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Original-Bytes: 3748 Date: 2013-04-02T16:59:12-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:1nrmzafa783kj.bcm8e5qfiiqi.dlg@40tude.net... > On Mon, 1 Apr 2013 19:52:10 -0500, Randy Brukardt wrote: > >> "Dmitry A. Kazakov" wrote in message >> news:1ilubaaaex6jp$.zd9lslst85nn.dlg@40tude.net... > >>> You lumped together two different contracts. There is a contract on the >>> actual parameters which is defined by be the formal parameters >>> specification. Another contract is the generic package specification >>> (public part), which is a contract for the clients using an instance of >>> the package. >> >> No I didn't - I'm only talking about the contract of a generic unit. > > It is more than one contract because a generic unit is used in two > completely different contexts: > > 1. Instantiation > > 2. Use of the instance I was only talking about the first. >> The case in question is the meaning of "not overriding" in a generic >> speecification. Uses of overriding indicators in a generic specification >> is >> part of the contract of the generic, as are various other things (like >> accessibility checks - it's easy to write a generic that can only be >> instantiated at library level). > > Considering the contract #1 it is a language design error. This contract > should be limited strictly to the formal part, IMO. Impossibility to > achieve that is one of multiple problems all macro expansions have (Ada > generics included). It would have been nice to keep the contract solely in the formal part, but it would have been way too complex to do that. (You'd have to have contracts for accessibility and overriding and a load of other things.) Since the instantiation contract can't be practically kept solely in the formal part, it would have been better to say from the begining that the entire specification participates in the contract (that is, have less separation). The existing syntax seems to imply that which cannot be delivered. Perhaps somehow marking contract items in the specification would have been a better plan. Anyway, we're stuck with the mess now. Thank Tucker for that. :-) [Rechecking in the instance was an Ada 95 invention.] Randy.