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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no 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!news3.google.com!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!news.skynet.be!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Generic package parameters not externally visible : what's the rational ? Date: Thu, 29 Oct 2009 17:56:51 -0500 Organization: Jacob Sparre Andersen Message-ID: References: <3084820f-4799-4555-b309-92c8ff7e2436@m16g2000yqc.googlegroups.com> <7e99bb5a-26a8-4ccb-b8d0-3b6882c40ebe@k17g2000yqb.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1256857012 23005 69.95.181.76 (29 Oct 2009 22:56:52 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 29 Oct 2009 22:56:52 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Xref: g2news2.google.com comp.lang.ada:8862 Date: 2009-10-29T17:56:51-05:00 List-Id: "Hibou57 (Yannick Duch�ne)" wrote in message news:7e99bb5a-26a8-4ccb-b8d0-3b6882c40ebe@k17g2000yqb.googlegroups.com... ... >I do not mean you comment is wrong, I just attempt to reply and >advocate an view on the situation. > >If I'm surely wrong on the long time, I want to know before I discover >it myself after a (too much) long time I don't have time to give you a detailed reply, sorry. (Well, not unless you want to hire me for consulting. :-) Let me just give my general thinking on this subject. I think formal packages should be used sparingly, in part because they complicate the use of a generic package (the more instances and parameters that you have write before anything useful can be done, the harder it is to understand and the more likely that you will just forget using the generic and "roll your own"). Typically, when I've had to compose generics, I will nest an instantiation of one inside the other. (That's pretty much all you could do in Ada 83, after all.) Most of the time, that works fine, and the operations in the instance can be used directly or re-exported with renames as needed. I also would have to agree with Dmitry (at least to a point) that generics can really interfere with your designs, so you need to use them sparingly. You can't avoid them completely when designing something like containers (for instance), but note that we made a strong effort to preserve the "single instance" model in almost all of the language-defined generics. We did that even at the cost of being able to have container interfaces (which would be really nice for abstraction purposes, but would require a second level of generic instances in order to be useful). Randy.