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,229ea0001655d6a2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder3.cambrium.nl!feeder1.cambrium.nl!feed.tweaknews.nl!news.netcologne.de!nhp.netcologne.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Generic Package From: Georg Bauhaus In-Reply-To: <1177616400.352571.308890@o40g2000prh.googlegroups.com> References: <1177539306.952515.222940@s33g2000prh.googlegroups.com> <1177601484.444701.171560@r35g2000prh.googlegroups.com> <1177603644.24583.15.camel@localhost.localdomain> <1177616400.352571.308890@o40g2000prh.googlegroups.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: # Message-Id: <1177617677.1504.19.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Date: Thu, 26 Apr 2007 22:01:18 +0200 NNTP-Posting-Date: 26 Apr 2007 22:01:18 CEST NNTP-Posting-Host: 33dd3034.newsspool3.arcor-online.net X-Trace: DXC=W@ko9TKON9RaoembcbF;DQMcF=Q^Z^V3X4Fo<]lROoRQFl8W>\BH3YR7nMcWi0PPl_A:ho7QcPOVSgiUa@TOl`d]UQKkVJ_dcNV X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:15322 Date: 2007-04-26T22:01:18+02:00 List-Id: On Thu, 2007-04-26 at 12:40 -0700, andrew.carroll@okstate.edu wrote: > Who said anything about derivation? Yeah, I used the word "is a" but > that doesn't mean I want to build a whole class tree. Ah, OK. > So, is there a "Generic_Collection" type of package in Ada? AFAIK, not in the sense that permits deciding the nature of the collection at runtime, or based on the type parameter (see also Dmitry's remarks). IIRC, Matt Heaney had originally intended to re-export the type T used as actual parameter for Element_Type of containers. In this case you might have written Tuples.Element_Subtype and instantiated other packages using this subtype without naming T. OTOH, the chaining is possible if I have understood correctly: package Tuple is new Vectors(Element_Type => attribute, ...); package Table is new Hashed_Sets(Element_Type => Tuple.Vector, ...);