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,4d2a71c8801ecab1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-05 18:26:36 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3D26473B.581C61BC@acm.org> From: Jeffrey Carter X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Common sense... References: <3D25E607.E59E11E2@acm.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sat, 06 Jul 2002 01:26:36 GMT NNTP-Posting-Host: 63.184.104.46 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 1025918796 63.184.104.46 (Fri, 05 Jul 2002 18:26:36 PDT) NNTP-Posting-Date: Fri, 05 Jul 2002 18:26:36 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:26895 Date: 2002-07-06T01:26:36+00:00 List-Id: "chris.danx" wrote: > > "Jeffrey Carter" wrote in message > news:3D25E607.E59E11E2@acm.org... > > Deleting nodes from an iterator is erroneous and should raise an > > exception. > > ok but how would you enforce that. Just not support it? That's no bother > as the iterators aren't written yet. The PragmAda Reusable Components' list components' iterators will raise an exception (Invalid_Position) if the client-supplied action deletes the current node. This is a consequence of assigning a unique ID to each list, marking each Position and node with the ID of the associated list, and invalidating the ID when a node is deleted. A simpler approach might be to add a Boolean field to the list structure that the iterator sets True before it begins traversing the list, and sets False when the iteration is finished. Deletion would then check this field first, and raise the exception if it is True. -- Jeff Carter "If you think you got a nasty taunting this time, you ain't heard nothing yet!" Monty Python and the Holy Grail