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,86a457a80a9f4412 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!217.73.144.44.MISMATCH!ecngs!feeder.ecngs.de!news.osn.de!diablo2.news.osn.de!news.belwue.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Generic Collection From: Georg Bauhaus In-Reply-To: <1178722277.733981.6200@l77g2000hsb.googlegroups.com> References: <1178652593.006083.173150@l77g2000hsb.googlegroups.com> <1178658022.9164.17.camel@kartoffel> <1178661586.585164.191690@e51g2000hsg.googlegroups.com> <1178722277.733981.6200@l77g2000hsb.googlegroups.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-ID: <1178727131.9164.38.camel@kartoffel> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Date: Wed, 09 May 2007 18:12:12 +0200 Organization: Arcor NNTP-Posting-Date: 09 May 2007 18:12:00 CEST NNTP-Posting-Host: 783e0b29.newsspool2.arcor-online.net X-Trace: DXC=YZ8UDH4IYC:QbA1[CgMQ00A9EHlD;3Yc24Fo<]lROoR18kF7i1 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:15678 Date: 2007-05-09T18:12:00+02:00 List-Id: On Wed, 2007-05-09 at 07:51 -0700, andrew wrote: > Actually I take that back. RDB2 looks promising with respect to how I > have my program now. What I want is to be able to change my program > so that I can declare table, tuple and schema to be of a "collection" > type like: > > table: collection; > tuple: collection; > schema: collection; The question now becomes, do you want table, tuple, and schema to have the same behavior? Then you could use instances of the same generic collection package, or interface types, or mimick duck types... Do you want table, tuple, and schema to be interchangeable parameters for some "common" subprograms (other than Add)? Are there cases where you want your program to decide which kind of collection it is reading? > This again would depend on being able to use a common object like Java > has. Interestingly, Java has recently got generics. In part, because this circumvents the consequences of everything being an Object. > What do you think? 42 if your intent is to blur the distinction between tuple, table, and schema to the extent that all have just one common type; a reader of you program might then have to inspect quite a bit of context to find out what is meant if something goes wrong. If this is the case, can you show that the similarities implied by Add and such should preclude any explicit distinction between tuple, table, and schema? OTOH, if they are Ada.Containers all of them will have a similar interface, even though this fact isn't reflected in an interface type.