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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.99.157.11 with SMTP id i11mr8897152pgd.78.1492881528961; Sat, 22 Apr 2017 10:18:48 -0700 (PDT) X-Received: by 10.157.6.166 with SMTP id 35mr402819otx.14.1492881528919; Sat, 22 Apr 2017 10:18:48 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!e132no1288128ite.0!news-out.google.com!v196ni1187ita.0!nntp.google.com!e132no1288124ite.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 22 Apr 2017 10:18:48 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=50.130.162.123; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 50.130.162.123 References: <178b6fbc-229b-49fc-8ffb-a5797bfc335f@googlegroups.com> <61e151c1-9fe6-4d32-8f13-d425bc41a616@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <488e2180-6c3e-4ad8-80dd-355a213d99f6@googlegroups.com> Subject: Re: Is there a reason System.Storage_Pools isn't Pure? From: Shark8 Injection-Date: Sat, 22 Apr 2017 17:18:48 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:46610 Date: 2017-04-22T10:18:48-07:00 List-Id: 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.