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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5c1125c290d9dd14 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!goblin2!goblin.stu.neva.ru!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!news.weisnix.org!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: ANN: Ada 2005 Math Extensions, 20100810 release Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <15e1x67lls1pe$.sqnhbm59hwdz$.dlg@40tude.net> <4c64f756$0$6985$9b4e6d93@newsspool4.arcor-online.net> Date: Fri, 13 Aug 2010 10:40:57 +0200 Message-ID: NNTP-Posting-Date: 13 Aug 2010 10:40:56 CEST NNTP-Posting-Host: 5bb18236.newsspool2.arcor-online.net X-Trace: DXC=>V^ejXa;>=7;]cDoEWD6A4A9EHlD;3Yc24Fo<]lROoR18kF[:IW[B5Y2 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:13205 Date: 2010-08-13T10:40:56+02:00 List-Id: On Fri, 13 Aug 2010 09:42:15 +0200, Georg Bauhaus wrote: > On 8/13/10 8:27 AM, Dmitry A. Kazakov wrote: > >> Another rule of thumb (I don't know if this is going to be fixed in Ada >> 2012), is that a child should always rename formal generic arguments in its >> specifications. Under certain circumstances, usually in children, they >> might become unavailable. I mean this: > > Would you mind showing an example of a name that is needed > but unavailable? >> generic >> with package P is new Generic_P (<>); >> package Generic_S is >> package P_Of renames P; -- You will need this! Do you mean the use case or the offending code? I cannot say for the latter because I have no idea when it happens and if the code is legal [*]. The simplest possible use case is the diamond diagram of generic packages [**]: A / \ B C \ / D In the specification of D you have to constrain B and C to the same A. For this you will need to refer the parameters of B and C: generic package A is end A; generic with package AA is new A (<>); package B is end B; generic with package AA is new A (<>); package C is end C; generic with package BB is new B (<>); with package CC is new C (BB.AA); -- Somewhere, somehow this ceases to work package D is end D; Note that Simon's problem is the same use case (just one shoulder of the diagram) but of different shape [*]: generic package A is end A; generic package A.B is end A.B; generic package A.C is end A.C; with A.B, A.C; generic with package AB is new A.B (my own A); -- No way! with package AC is new A.C (my own A); -- No way! package A.D is end D; ----------- * Generics is a mess, remember? ** We were told how dreadful the diamond is, so bad that Ada may not allow to have MI, but for sacred generics anything is perfectly OK! -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de