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,842accb6a7d76669 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-04 11:06:44 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!netnews.com!xfer02.netnews.com!newsfeed1.cidera.com!Cidera!cyclone1.gnilink.net!news-east.rr.com!news-west.rr.com!lsnws01.we.mediaone.net!typhoon.san.rr.com!not-for-mail Message-ID: <3BE591CB.72F76462@san.rr.com> From: Darren New Organization: Boxes! X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: List container strawman 1.1 References: <3BE301D1.4010106@telepath.com> <3BE31DD5.FF96AFE0@san.rr.com> <3BE43E6D.109111F4@acm.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sun, 04 Nov 2001 19:07:06 GMT NNTP-Posting-Host: 66.75.151.160 X-Complaints-To: abuse@rr.com X-Trace: typhoon.san.rr.com 1004900826 66.75.151.160 (Sun, 04 Nov 2001 11:07:06 PST) NNTP-Posting-Date: Sun, 04 Nov 2001 11:07:06 PST Xref: archiver1.google.com comp.lang.ada:15768 Date: 2001-11-04T19:07:06+00:00 List-Id: Jeffrey Carter wrote: > A reason to include the list with the Position is so you can ensure that > the user is not by accident using a pointer to a different list than > desired, but it's more commonly done so you can adjust the list's first > or last pointer if the first or last node is deleted. My thought was that it would be better to keep a pointer to the list in the "iterator". That is, each iterator can only refer to one list (except for the "off the end" iterator which I feel is a bad design here), so why not? You're not ensuring that the person isn't accidentally using the wrong list. You're just making them say which list they think they're using, and passing the right pointer but the wrong list isn't going to be detected anyway. I.e., it's actually bad, because if you pass the right pointer and the wrong list, and you try to delete the first record, you'll get a different kind of failure than if you try to delete the record in the middle. Better to always delete from the wrong list than to sometimes delete from the wrong list, I think. -- Darren New San Diego, CA, USA (PST). Cryptokeys on demand. Sore feet from standing in line at airport security checkpoints: Jet Leg.