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,fd8f3d2ebf73a4b7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-21 09:53:29 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!195.64.68.27!newsgate.cistron.nl!news2.euro.net!uunet!ash.uu.net!xyzzy!nntp From: Jeffrey Carter Subject: Re: Whether to raise exception or End_of_List function X-Nntp-Posting-Host: e246420.msc.az.boeing.com Content-Type: text/plain; charset=us-ascii Message-ID: <3BFBE04B.ED527ACD@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 7bit Organization: The Boeing Company X-Accept-Language: en References: Mime-Version: 1.0 Date: Wed, 21 Nov 2001 17:11:39 GMT X-Mailer: Mozilla 4.73 [en]C-CCK-MCD Boeing Kit (WinNT; U) Xref: archiver1.google.com comp.lang.ada:16808 Date: 2001-11-21T17:11:39+00:00 List-Id: Preben Randhol wrote: > [about advancing a position in a list until the end of the list is reached] > My question is which is the better solution; Exception or a End_of_List > function and which would have fewer side effects? >From the component creation point of view, the approach taken by most industrial-strength components is to provide a function so the client can avoid doing something meaningless, such as trying to look at the item referenced by an invalid position, but to also define and raise an exception if the client ignores or doesn't use the function. >From the client point of view, it's probably best to use the function. -- Jeffrey Carter