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.129.122.19 with SMTP id v19mr3148876ywc.26.1464970838201; Fri, 03 Jun 2016 09:20:38 -0700 (PDT) X-Received: by 10.157.10.23 with SMTP id 23mr63102otg.12.1464970838165; Fri, 03 Jun 2016 09:20:38 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!q32no3198107qgq.0!news-out.google.com!z5ni79qge.0!nntp.google.com!p34no2178726qgp.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 3 Jun 2016 09:20:37 -0700 (PDT) In-Reply-To: <1bc41b66-8dd4-4b4e-903e-f314babc07f9@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=193.163.1.105; posting-account=Srm5lQoAAAAEMX9rv2ilEKR6FDPapmSq NNTP-Posting-Host: 193.163.1.105 References: <1bc41b66-8dd4-4b4e-903e-f314babc07f9@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Buffer PO From: Mark Lorenzen Injection-Date: Fri, 03 Jun 2016 16:20:38 +0000 Content-Type: text/plain; charset=UTF-8 X-Received-Bytes: 2144 X-Received-Body-CRC: 2571232948 Xref: news.eternal-september.org comp.lang.ada:30582 Date: 2016-06-03T09:20:37-07:00 List-Id: On Friday, June 3, 2016 at 3:29:14 PM UTC+2, tonyg wrote: > I have a Fifo buffer in a protect object with a push / pop procedures and an is_empty function storing a gaggle of variant records. > > I push just fine but when I come to collect my data with a pop, I have to assign it to a variable which is predeclared. > > I cannot use a function as this cannot change the inside of a protected object. > > Now I could use an extra buffer to contain the variant record discriminator but is there a better way? > > I did think of adding a function to peek at the discriminator, but this could cause a problem as a push may change the record being viewed before my pop. I cannot really understand what your problem is, but I think you want to return a discriminated record in a protected procedure call and that gives you problems with the discriminant set by the caller. You should use a default discriminant as this allows for the (protected) procedure to modify the discriminant of the object passed to the procedure. Regards, Mark L