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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable 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 10:42:27 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: "Steven Deller" Newsgroups: comp.lang.ada Subject: RE: List container strawman 1.2 Date: Mon, 12 Nov 2001 13:39:50 -0500 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1005590546 63662 137.194.161.2 (12 Nov 2001 18:42:26 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Mon, 12 Nov 2001 18:42:26 +0000 (UTC) To: Return-Path: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 In-reply-to: <9soq34$be6$1@nh.pace.co.uk> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.6 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , List-Archive: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:16351 Date: 2001-11-12T13:39:50-05:00 > -----Original Message----- > From: comp.lang.ada-admin@ada.eu.org > [mailto:comp.lang.ada-admin@ada.eu.org] On Behalf Of Marin > David Condic ] > Sent: Monday, November 12, 2001 10:33 AM > To: comp.lang.ada@ada.eu.org > Subject: Re: List container strawman 1.2 > > > 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. In many "interesting" cases, duplicates are only defined over a subset of the information in an element. The approach suggested does not have sufficient power to handle anything except "simple" duplication. If could also provide a generic "=" for the elements then perhaps it is useful. Also, these lists are NOT sorted, so non-duplication would require searching the entire list for each insertion. As I said in previous email, it is not good to have O(N) performance for primitive operations on primitive structures. Non-duplication insertion is better left to implementations intended for sorted lists. In which case, I'd expect "insert based on key" to be one of the primitive operations. And the user would NOT have the ability to specify where in a list an insertion was going to be done. Regards, Steve