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!postnews.google.com!e51g2000hsg.googlegroups.com!not-for-mail From: andrew Newsgroups: comp.lang.ada Subject: Re: Generic Collection Date: 11 May 2007 14:55:22 -0700 Organization: http://groups.google.com Message-ID: <1178920522.908098.104500@e51g2000hsg.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> <1178727131.9164.38.camel@kartoffel> <1178736886.994385.37140@y80g2000hsf.googlegroups.com> <1178837285.391940.192010@e65g2000hsc.googlegroups.com> <1178871050.6451.13.camel@localhost.localdomain> <1178916106.931240.40880@p77g2000hsh.googlegroups.com> <1178918914.8423.47.camel@localhost.localdomain> NNTP-Posting-Host: 139.78.128.110 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1178920523 32228 127.0.0.1 (11 May 2007 21:55:23 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 11 May 2007 21:55:23 +0000 (UTC) In-Reply-To: <1178918914.8423.47.camel@localhost.localdomain> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.1; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: e51g2000hsg.googlegroups.com; posting-host=139.78.128.110; posting-account=Kq9unQ0AAADh_grEViI3JGqegXKDDjxt Xref: g2news1.google.com comp.lang.ada:15772 Date: 2007-05-11T14:55:22-07:00 List-Id: On May 11, 4:28 pm, Georg Bauhaus wrote: > If you don't care that there is only one type of collection for > all kinds of objects, then indeed references to DB_thing'class > objects seem a plausible choice for storing table objects in > collection. Where > > type DB_thing is abstract tagged private; > type DB_thing_ref is access DB_thing'class; > > type attribute is new DB_thing with private; > type tuple is new DB_thing with private; > ... > > package DB_collections is new Containers.Hashed_Sets > (Element_Type => DB_thing_ref, ...); > > subtype collection is DB_collections.Set; I'm going to have to look at this more. So far it looks promising. > Is there really a sufficiently common algorithm for schemas, > tables, tuples, and attributes? add, remove, getnext, find, sort, search, etcetera. So yeah, the basic collection of things type of operations. > > > > I don't understand why I would have run-time errors. Please expand > > > > that thought. > > > > Just think of the consequences of Java pre-1.5 collections delivering > > > nothing but Object objects. > > There was a problem with delivering objects of type Object? > > Yes, there was a problem with everything being of type Object. > For example, retrieving references from collections forces > type checking at run time and throwing ClassCastException > when there is a mismatch. > some_ref = (IKnowWhatType) container.get(some_key); > That is a reason why Java now has generics. OOOHHHHH, that...shoot, you had me going there for a minute. I thought it was something _serious_ that somehow is related to a problem that Ada would have.