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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,85361ba1ea5f711 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-22 13:37:17 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!bigfeed2.bellsouth.net!news.bellsouth.net!elnk-atl-nf1!newsfeed.earthlink.net!border2.nntp.ash.giganews.com!border1.nntp.ash.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!nntp.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 22 Dec 2003 15:37:16 -0600 Date: Mon, 22 Dec 2003 16:37:15 -0500 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: iterators as first class objects References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.34.214.193 X-Trace: sv3-ryUoO5UwmjGgHy6VYKHsHP/yYGG0edzrfdgljNLA+mCe9BzGu5r1e0oaP7CEaBxCpGty+uduAX3FG5M!5GIvobxpbGWrB5wyUWxtOpI6qTf1EXj1WoxBXvtH3PUG5NLPVY7Juuns9EpHSg== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:3714 Date: 2003-12-22T16:37:15-05:00 List-Id: Lionel.DRAGHI@fr.thalesgroup.com wrote: > 2 - within the component, the whole array is build: with an iterator, you > may exit before the end. > > This is why we use it only for small data structure. > > As this leads to crystal-clear user's code, and as it's a common need, I > think it's worth thinking about langage extension. Which is why, as I said elsewhere I usually provide both the array view and a global next operation. It is not an iterator because it removes the object from the structure before returning it. If you want to think of this as an array view, and a queue view, fine, although the Next operation maps well to all data structures. (If the user doesn't care about order (a bag) he still gets one item at a time with no repetition. -- Robert I. Eachus "The war on terror is a different kind of war, waged capture by capture, cell by cell, and victory by victory. Our security is assured by our perseverance and by our sure belief in the success of liberty." -- George W. Bush