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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a644fa9cd1a3869a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-13 11:18:34 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: List container strawman 1.2 Date: 13 Nov 2001 14:10:31 -0500 Organization: NASA Goddard Space Flight Center Message-ID: References: <3BECA3B7.5020702@telepath.com> <3bef920f@pull.gecm.com> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1005678789 2293 128.183.220.71 (13 Nov 2001 19:13:09 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 13 Nov 2001 19:13:09 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Xref: archiver1.google.com comp.lang.ada:16433 Date: 2001-11-13T19:13:09+00:00 List-Id: "Martin Dowie" writes: > "Ted Dennison" wrote in message > news:3BECA3B7.5020702@telepath.com... > [snip] > > -------------------------------------------------------------------------- > ----- > > -- This file contains a proposal for a standard Ada list package. > > -- > > -- version - Strawman 1.2 > > -------------------------------------------------------------------------- > ----- > > generic > > type Element is private; > > package Containers.Lists.Unbounded is > > Hmm, how about adding two lines to this to allow a list to be specified > as having 'unique' items or not? e.g. > > generic > type Element is private; > Elements_Must_Be_Unique : Boolean; > function "=" (L, R : Element) return Boolean; > package Containers.Lists.Unbounded is > > I have found this to be very useful in the past - but this may > have just been the specifics of the problem domain I was working > in. Actually, I prefer three choices for "duplicates"; ignore, error, and allow. I use "ignore" when I'm accumulating lists of Ada packages to "with" (in an ASIS application); each package is on the list only once. I use "error" when the program logic forbids duplicates; lists of people, for example. I use "allow" in other situations, usually when "compare" actually makes no sense (a list of GUI controls). This feature is not yet in my on-line version of SAL; I have not been keeping it up to date. -- -- Stephe