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=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:b608:: with SMTP id g8-v6mr2242402itf.13.1527304394257; Fri, 25 May 2018 20:13:14 -0700 (PDT) X-Received: by 2002:a9d:6183:: with SMTP id g3-v6mr323491otk.3.1527304394030; Fri, 25 May 2018 20:13:14 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!news.redatomik.org!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!85.12.16.69.MISMATCH!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!v8-v6no2794860itc.0!news-out.google.com!f20-v6ni2539itd.0!nntp.google.com!u74-v6no2789075itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 25 May 2018 20:13:13 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.218.37.33; posting-account=W2gdXQoAAADxIuhBWhPFjUps3wUp4RhQ NNTP-Posting-Host: 76.218.37.33 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Multiple iterators for a type From: Stephen Leake Injection-Date: Sat, 26 May 2018 03:13:14 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 2011 X-Received-Body-CRC: 3323065101 Xref: reader02.eternal-september.org comp.lang.ada:52687 Date: 2018-05-25T20:13:13-07:00 List-Id: On Friday, May 25, 2018 at 11:49:48 AM UTC-5, Lucretia wrote: > Hi, > > I want to have a type which is an array of 8 bit values, I want the default iterator to be the normal array loop. > > But then I want to add more iterators which return different types but constructed from the array, i.e. a 32-bit value and a sub-array. > > 1. Can this be done on the base type or do I need to create new types from the base type? > > 2. if 1. can be done, do these iterators all need to be one package or can I put them in child packages? > > Thanks, > Luke. An "iterator" can be anything you want it to be. As Randy pointed out, there can be only one that gets special treatment from the compiler, but you did not mention that as a requirement.