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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!31g2000vbf.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Generic package parameters not externally visible : what's the rational ? Date: Mon, 26 Oct 2009 01:58:55 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 77.198.58.174 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1256547535 5813 127.0.0.1 (26 Oct 2009 08:58:55 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 26 Oct 2009 08:58:55 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 31g2000vbf.googlegroups.com; posting-host=77.198.58.174; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8783 Date: 2009-10-26T01:58:55-07:00 List-Id: Hello ghosts out there, 24h without even a single post on comp.lang.ada... I hope every body is Ok. Still the time for my two cents of the day : parameters of generic packages are not externally visible. I use to read in a few places on the web, this is so to preserve type privacy, but without any examples which could illustrate this view. What's the rational behind this ? I like to do something like this to work around this : generic Parameter_Type is (<>); -- Other generic parameters ... package Generic_Package is -- Give external access to generic parameters which are not visible otherwise. subtype Formal_Parameter_Type is Parameter_Type -- The same for other generic parameters ... -- Remaining of the package ... end Generic_Package; I feel it is oftenly useful to have external access to generic parameters : it is more clear and more consistent than making reference to stuffs from different source (finally, the package instance is a place where all these references are available, so why not use these). I feel this is especially useful when other generic packages are instantiated using the same parameters used to instantiate another generic packages. That's why I was wondering about the rational which is underlying to this restriction (the one which disallows a generic parameter to be externally visible). Have a nice time (if every one is Ok).