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,c84654714c2f5945 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: GNAT GPL Edition - on the plus side Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.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: <1u927xnbmsfw1$.1xg4jk31952ts$.dlg@40tude.net> <4350010e$0$24167$9b4e6d93@newsread4.arcor-online.net> Date: Sat, 15 Oct 2005 11:28:50 +0200 Message-ID: <5rv6uxpgk12.pv7zbyqkvumw.dlg@40tude.net> NNTP-Posting-Date: 15 Oct 2005 11:28:37 MEST NNTP-Posting-Host: 16492406.newsread2.arcor-online.net X-Trace: DXC=lBFg9I\=]oIJ2=Pn8=T1[JQ5U85hF6f;DjW\KbG]kaMHQ>n?D9BSA]LF@UejW3LEXO[6LHn;2LCVN[ On Fri, 14 Oct 2005 21:05:31 +0200, Georg Bauhaus wrote: > Dmitry A. Kazakov wrote: > >> It >> seems that GNAT somehow messes up the names of the actual parameters with >> ones of the formal parameters upon instantiation. At least some problems >> can be circumventing by avoiding actual and formal parameter having the >> same name! (:-)) > > Even when GNAT doesn't properly handle the load of overload, > this defect might actually help improve software quality. :-) Well, GNAT bugs often forced me to review my designs. It always is a good idea to review... though I wouldn't give compiler bugs honor for that. Of course if the error message were: "sorry, at the moment we cannot compile your legal code, but if you change this and that ..." BTW, GNAT often says X is invisible (because of ...) but *a* use clause might make it visible. But it never reveals which one! (:-)) > A one-name-for-one-thing-rule has made it into a programming > language standard (Eiffel), and I think the rule is justified. Ooch, do you seriously claim that the following should be outlawed: procedure Foo (X : in out Integer); -------------------------- X : Integer; begin Foo (X); -- Illegal: the same name for actual and formal! (:-)) BTW, the above is not one name, one thing. It is one name, two things. If you really wanted to have one name, one thing, you ought to disallow all sorts of renaming and use-ing. I don't think that would be a good idea. It is true that renaming in Ada have problems, but those are rather design problems, which can be relatively easily fixed: 1. Renaming should keep contracts (Example: renaming that shifts array index shall either be illegal or indeed shift it) 2. Renaming shall never, under any circumstances be able to hide the thing it renames. 3. There must be renaming for types. It follows from 2, and anyway, subtype S is T; is a fundamentally different thing. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de