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,da85d9aaf769b16a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!weretis.net!feeder2.news.weretis.net!news.tornevall.net!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Generic package parameters not externally visible : what's the rational ? Date: Tue, 27 Oct 2009 15:19:11 -0700 Organization: TornevallNET - http://news.tornevall.net Message-ID: References: <3084820f-4799-4555-b309-92c8ff7e2436@m16g2000yqc.googlegroups.com> NNTP-Posting-Host: 495d69a46bedbdb016b3997374333701 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: 6e4a4ed3e3600827ef614081bfef4570 X-Complaints-To: abuse@tornevall.net X-Complaints-Language: Spoken language is english or swedish - NOT ITALIAN, FRENCH, GERMAN OR ANY OTHER LANGUAGE! In-Reply-To: <3084820f-4799-4555-b309-92c8ff7e2436@m16g2000yqc.googlegroups.com> X-Validate-Post: http://news.tornevall.net/validate.php?trace=6e4a4ed3e3600827ef614081bfef4570 X-SpeedUI: 1738 X-Complaints-Italiano: Parlo la lingua non � italiano User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) X-Posting-User: 9b22bfe2855937f9b3faeec7cfc91295 Xref: g2news2.google.com comp.lang.ada:8816 Date: 2009-10-27T15:19:11-07:00 List-Id: Hibou57 (Yannick Duch�ne) wrote: > > One good reason to miss it, is when a package A has another package B > in its formal parameters and this formal package parameter (B) is it > self generic, and A needs to use some type which were given to > instantiate the package B. This is an example case where the parameter > which were used to instantiate a package, are not accessible from a > point they are needed (if P instantiated B, of course P has access to > parameters used to instantiate B, but this does not help A, it if ever > itself also need these). But Ada allows a generic to reference the unknown generic parameters of its formal package parameters. See ARM 12.7. > To come back to the first point : one other good reason apart of a > generic package having another generic in its parameters, is when a > generic package B may also be instantiated in a package A, which will > then be use in another package C, which does not have direct access to > the parameters used to instantiate the package (let say it was in a > third package which A deeply rely on one, but not C). Then, one of the > more natural way to access these, if ever needed for other stuff in C, > is the generic package instance B itself. Then C clearly has a dependency on this 4th pkg (shall we call it D?), and that dependency should be made explicit, by including "with D;" on C. -- Jeff Carter "We'll make Rock Ridge think it's a chicken that got caught in a tractor's nuts!" Blazing Saddles 87