comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <onewingedshark@gmail.com>
Subject: Re: Is there a reason System.Storage_Pools isn't Pure?
Date: Sat, 22 Apr 2017 10:18:48 -0700 (PDT)
Date: 2017-04-22T10:18:48-07:00	[thread overview]
Message-ID: <488e2180-6c3e-4ad8-80dd-355a213d99f6@googlegroups.com> (raw)
In-Reply-To: <odeo5r$2dm$1@franka.jacob-sparre.dk>

On Friday, April 21, 2017 at 11:02:52 PM UTC-6, Randy Brukardt wrote:
> "Shark8" wrote in message 
> news:a498c0f6-11ae-4050-ade0-bc35c686dc1c...
> > On Wednesday, April 19, 2017 at 2:36:28 PM UTC-6, Randy Brukardt wrote:
> >>
> >> Your spec here doesn't have any way to put an element into the holder. 
> >> And
> >> that's where the trouble comes (especially for limited types!). Perhaps 
> >> you
> >> can figure it out (I haven't been able to). As it stands, your holder
> >> objects would have to have Has_Element = False. Not very useful. ;-)
> >
> > I should have known better than to type it on-the-fly.
> > Here's a different spec that actually does compile under GNAT, even though 
> > [AFACT] it shouldn't:
> 
> Right; it contains an assignment of a limited private type, which is, ummm, 
> surprising. :-)

For Replace_Element?
There's no assignment of a limited private type there, it's an assignment replacing the whole parameter "container", which is in this case an access type.
(Or do you mean in To_Holder?)

> 
> You probably could use a constructor allocator to do that in limited (pun 
> not intended) cases, but that would be a new object which couldn't exist 
> outside of the container. Might be useful in some cases...

Sounds like a good way to (e.g.) bind a value to a particular storage [sub]pool, IIUC.

      reply	other threads:[~2017-04-22 17:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18  6:31 Is there a reason System.Storage_Pools isn't Pure? Shark8
2017-04-18 18:32 ` Randy Brukardt
2017-04-18 23:42   ` Shark8
2017-04-19  7:37     ` Dmitry A. Kazakov
2017-04-19 18:50       ` Shark8
2017-04-19 19:48         ` Dmitry A. Kazakov
2017-04-19 20:42       ` Randy Brukardt
2017-04-19 20:36     ` Randy Brukardt
2017-04-20  0:12       ` Shark8
2017-04-22  5:02         ` Randy Brukardt
2017-04-22 17:18           ` Shark8 [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox