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.3 required=3.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!CoO8DKwN1NpS7UuKxER5kQ.user.gioia.aioe.org.POSTED!not-for-mail From: "Nasser M. Abbasi" Newsgroups: comp.lang.ada Subject: Re: calling function but ignoring results Date: Fri, 2 Jul 2021 20:22:55 -0500 Organization: Aioe.org NNTP Server Message-ID: References: <69a59fdc-72bb-4202-99fc-d776530de653n@googlegroups.com> Reply-To: nma@12000.org NNTP-Posting-Host: CoO8DKwN1NpS7UuKxER5kQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader02.eternal-september.org comp.lang.ada:62318 List-Id: On 6/29/2021 2: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; > > I also see the procedure wrapper used in some cases -- usually when exported in a package specification: > > procedure FOO( x, y ) is > b : BOOLEAN; > begin > b := foo( x, y ); > end FOO; > fyi, Matlab had this for years: https://www.mathworks.com/help/matlab/matlab_prog/ignore-function-outputs.html " This example shows how to ignore specific outputs from a function using the tilde (~) operator. To ignore function outputs in any position in the argument list, use the tilde operator. For example, ignore the first output using a tilde. [~,name,ext] = fileparts(helpFile); " --Nasser