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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,effb80d4bb7716dd X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Wanted: Ada STL. Reward: Ada's Future Date: 1999/02/01 Message-ID: #1/1 X-Deja-AN: 439193205 Sender: matt@mheaney.ni.net References: <790f4q$3l@bgtnsc01.worldnet.att.net> NNTP-Posting-Date: Sun, 31 Jan 1999 17:04:35 PDT Newsgroups: comp.lang.ada Date: 1999-02-01T00:00:00+00:00 List-Id: "Alexy V Khrabrov" writes: > I did found the Booch Components, fortunately picked up after David Weller > gave them up, but they don't even have sets, for Pete's sake! Yet for > anything simple, you need sets the first thing in the morning. I need them > for clustering. Students need them for the beaten to death students/courses > problem. Everybody needs sets. Where do you get them in Ada 95? On the contrary, a set is next-to-useless as a collection abstraction in any real program. A set is an unordered collection without duplicates. The problem with a set is that when you add an item to the set, you have to check the entire set to make sure that the item isn't already in the set. That's fine if that's the behavior you want. However, it has been my personal experience that this is not the abstraction you require. Typically, all you need is an abstraction for an unordered collection. When you add an item to the collection, it puts (a copy of) the item in the collection, without any checks. The problem with many data structure texts is that they omit any discussion of this important abstraction. And so everyone goes through life thinking that a set (or multiset) is the only kind of unordered collection that exists. In my work on the ACL (which I suspended until gnat 3.11p came out: it wouldn't compile otherwise), I call this kind of abstraction a "container." There is only a minimal set of operations on a Container type: o add an item to the container o iterate over items in the container o remove the item currently designated by an (active) iterator The first thing in the morning you need a Container, not a Set.