From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: container cursor type cannot be tagged
Date: Fri, 29 Aug 2014 18:00:56 -0500
Date: 2014-08-29T18:00:56-05:00 [thread overview]
Message-ID: <ltr0n8$b1g$1@loke.gir.dk> (raw)
In-Reply-To: 85d2bjxscf.fsf@stephe-leake.org
"Stephen Leake" <stephen_leake@stephe-leake.org> wrote in message
news:85d2bjxscf.fsf@stephe-leake.org...
> "Randy Brukardt" <randy@rrsoftware.com> 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.
next prev parent reply other threads:[~2014-08-29 23:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-28 19:21 container cursor type cannot be tagged Stephen Leake
2014-08-28 20:25 ` Randy Brukardt
2014-08-29 7:28 ` Dmitry A. Kazakov
2014-08-29 7:59 ` J-P. Rosen
2014-08-29 8:46 ` Dmitry A. Kazakov
2014-08-29 23:08 ` Randy Brukardt
2014-08-29 14:50 ` Stephen Leake
2014-08-29 23:00 ` Randy Brukardt [this message]
2014-08-30 15:16 ` Stephen Leake
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox