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!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.stack.nl!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: container cursor type cannot be tagged Date: Fri, 29 Aug 2014 18:00:56 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <85ppfkxvwg.fsf@stephe-leake.org> <85d2bjxscf.fsf@stephe-leake.org> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1409353256 11312 69.95.181.76 (29 Aug 2014 23:00:56 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 29 Aug 2014 23:00:56 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:22000 Date: 2014-08-29T18:00:56-05:00 List-Id: "Stephen Leake" wrote in message news:85d2bjxscf.fsf@stephe-leake.org... > "Randy Brukardt" writes: >> That seems to make more sense, honestly. But how are you dealing with the >> "can't have two tagged types" problem for the container itself? > > I don't see the problem; I declared my container with tagged container > and cursor, and only had a problem when I tried to instantiate > Ada.Iterator_Interfaces. How did you do that? Any operation that takes a container and a cursor is illegal if both are tagged. I don't see how you could have a constructor for a cursor in that case (it must at least take a container and return a cursor), and operations involving container updates could work as cursor-only operations but are dangerous (because they would allow writing constant containers). Using Cursor'Class in this circumstance is a lie (there never will be any derived types that work) and of course forces checking to runtime (or not at all). Randy.