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=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no 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-12 08:03:43 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!psinet-eu-nl!psiuk-p4!psiuk-p3!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: List container strawman 1.2 Date: Mon, 12 Nov 2001 10:32:50 -0500 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9soq34$be6$1@nh.pace.co.uk> References: <3BECA3B7.5020702@telepath.com> <3bef920f@pull.gecm.com> NNTP-Posting-Host: dhcp-200-133.miami.pace.co.uk X-Trace: nh.pace.co.uk 1005579172 11718 136.170.200.133 (12 Nov 2001 15:32:52 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 12 Nov 2001 15:32:52 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:16329 Date: 2001-11-12T15:32:52+00:00 List-Id: Lots of ways of handling that. I agree that there are cases where you want a list to contain only one sample of a given element, but I'd prefer that the instantiation doesn't force someone to make that decision and have to provide parameters that may be unnecessary for the simple cases. It could just as easily be done by providing a subprogram to set a flag in the List object that disallows/allows duplicates. Or alternately, returning a flag on insertion indicating there was a duplicate or providing a function to test for a duplicate, or .... ? IOW, default behavior is "duplicates allowed" unless you call "Disallow_Duplicates (My_List_Object) ;" or something similar. MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Martin Dowie" wrote in message news:3bef920f@pull.gecm.com... > "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. > > >