From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.0 required=3.0 tests=BAYES_40,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a37:2e81:: with SMTP id u123mr1313234qkh.24.1625162862009; Thu, 01 Jul 2021 11:07:42 -0700 (PDT) X-Received: by 2002:a25:aa09:: with SMTP id s9mr1323962ybi.165.1625162861585; Thu, 01 Jul 2021 11:07:41 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 1 Jul 2021 11:07:41 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=95.238.131.152; posting-account=JRF_-woAAABYlsAtkCl_CUxBuQy2SsaQ NNTP-Posting-Host: 95.238.131.152 References: <69a59fdc-72bb-4202-99fc-d776530de653n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: calling function but ignoring results From: Gabriele Galeotti Injection-Date: Thu, 01 Jul 2021 18:07:42 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:62314 List-Id: On Tuesday, June 29, 2021 at 9:52:40 PM UTC+2, Jeffrey R. Carter wrote: > On 6/29/21 9:25 PM, Matt Borchers wrote: > > It is not very often that ignoring a function result is okay, but I have run across many instances of the following block structure in code over the years: > > > > declare > > dont_care : BOOLEAN; > > begin > > dont_care := foo( x, y ); > > end; > This sort of thing usually indicates a design problem. > > Is there a Ada 202x feature to support calling functions and ignoring the result? > If you want to use a language that allows this, then you probably shouldn't be > developing S/W. > > -- > Jeff Carter > "Blessed is just about anyone with a vested interest in the status quo." > Monty Python's Life of Brian > 73 Yes, you are right. But sometimes it is necessary (especially at the H/W level) to force a read of a peripheral register in order to obtain a specific behaviour, e.g., clear an interrupt or latch a value previously written; in these cases what you read is useless. G