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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.109.57.126.0.mobile.3.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Multiple iterators for a type Date: Fri, 25 May 2018 21:50:08 +0200 Organization: JSA Research & Innovation Message-ID: <87o9h3qzv3.fsf@jacob-sparre.dk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: franka.jacob-sparre.dk; posting-host="109.57.126.0.mobile.3.dk:109.57.126.0"; logging-data="10091"; mail-complaints-to="news@jacob-sparre.dk" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:3fWE+WQyt9DExCSZaHRv1J2CB18= Xref: reader02.eternal-september.org comp.lang.ada:52682 Date: 2018-05-25T21:50:08+02:00 List-Id: Lucretia writes: > 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? It can be done on 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? They can be in child packages. Or even locally defined in the subprogram where you use them. Greetings, Jacob -- "War does not determine who is right - only who is left." -- Bertrand Russell