From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED.pBWEO6hi52oGFheO/GY5ag.user.gioia.aioe.org!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Generalized Loop Iteration and User-Defined Indexing with more than two parameters. Date: Sat, 07 Nov 2020 15:54:14 -0800 Organization: Aioe.org NNTP Server Message-ID: <864km0vi3d.fsf@stephe-leake.org> References: <86361qwvht.fsf@stephe-leake.org> NNTP-Posting-Host: pBWEO6hi52oGFheO/GY5ag.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (windows-nt) X-Notice: Filtered by postfilter v. 0.9.2 Cancel-Lock: sha1:RnOcw/NVfsFj1Yd5gIifEwPoYyU= Xref: reader02.eternal-september.org comp.lang.ada:60562 List-Id: "Randy Brukardt" writes: > "Blady" wrote in message > news:ro3qms$1vdh$1@gioia.aioe.org... > >> 2) In Ada.Iterator_Interfaces, why Has_Element is a generic formal >> parameter instead of an abstract function of Forward_Iterator interface? >> As: >> function Has_Element >> (Object : Forward_Iterator; >> Position : Cursor) return Boolean is abstract; >> The current way requires that Cursor type has the container reference >> embedded and cannot be a simple index type. > > I suppose other designs could have been chosen. In addition, you can store the container reference in your Iterator object. -- -- Stephe Written from unceded ancestral homelands of the Huichiun, an Ohlone people,for which I pay Shuumi Land Tax