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,5c1125c290d9dd14 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: ANN: Ada 2005 Math Extensions, 20100810 release Date: Fri, 13 Aug 2010 20:50:07 +0100 Organization: A noiseless patient Spider Message-ID: References: <15e1x67lls1pe$.sqnhbm59hwdz$.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Fri, 13 Aug 2010 19:50:07 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="KCXegvZb5vh43D+f3BR6Ew"; logging-data="16263"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/YmrkOG1DB1a+TBotS3Y/Ffj49IZGFTuw=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:+J2e4whPgycMm42l2T3R5403OxU= sha1:LMx39eT5vXu/oyyvIMV5fhUvtVc= Xref: g2news1.google.com comp.lang.ada:13239 Date: 2010-08-13T20:50:07+01:00 List-Id: "Dmitry A. Kazakov" writes: > Yes, especially because of two "Extensions". I had immense problems with > names. Look at this: > > http://www.dmitry-kazakov.de/ada/fuzzy_packages.gif Gosh! >From a UML background (OK, OK, ...) I'd have the arrows pointing the other way ('depends on' rather than 'is used in' or 'supports'). > Somewhere down deep the hierarchy the user starts to become > incomprehensive error messages upon instantiation within the > generic(!) bodies. It is practically impossible to understand what is > wrong, is it a compiler bug (in GNAT case) or something else. For the > user it would be a nightmare to fight this. I think I've come across a GNAT bug here .. I dont think it's allowed for a generic to compile but the instantiation not! > 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: > > generic > with package P is new Generic_P (<>); > package Generic_S is > package P_Of renames P; -- You will need this! > > Sometimes you need to "rename" formal types as well: > > generic > type Foo is ... > package Generic_S is > subtype Foo_Of is Foo; -- What a mess! I've more often come across the latter. Could consider generic type Formal_Foo is ... package Generic_S is subtype Foo is Formal_Foo;