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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!mx05.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Gnat 2013 is out! Date: Fri, 31 May 2013 09:41:56 +0200 Organization: cbb software GmbH Message-ID: <1klsxf6xj66gd.1op1f7fzgp4l$.dlg@40tude.net> References: <32d94173-533a-471e-95a0-abb73a6cdcc2@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:15680 Date: 2013-05-31T09:41:56+02:00 List-Id: On Thu, 30 May 2013 14:53:43 -0500, Randy Brukardt wrote: > "Adam Beneschan" wrote in message > news:32d94173-533a-471e-95a0-abb73a6cdcc2@googlegroups.com... > On Wednesday, May 29, 2013 3:39:44 PM UTC-7, Randy Brukardt wrote: > >>I've always wanted some kind of feature in Ada that would allow a caller to >>provide a >>"dummy" for OUT parameters, without having to declare a new variable. The >>compiler >>would allocate a temporary object (and a separate one for each use of a >>"dummy") and >>then discard it after the call. It wouldn't work well when parameter types >>are >>unconstrained array or discriminant records, though. > > Hmm, that seems like a good idea to me. But what would the syntax be? <> > maybe? > > My_Proc (Obj1, Obj2, Result => <>); As well as function results: <> := My_Func (Obj1, Obj2); -- I do this for side effects! Back in 90's I thought about null statement: null My_Func (Obj1, Obj2); But for procedures it won't work: My_Proc (Obj1, Obj2, Result => null); -- Ambiguous > I tried to work out a solution based on default parameters for all modes > (which would provide your dummy result along with other uses), but it didn't > work out very well. The main problem was that the default objects usually > had to be globals, and that could cause an unsafe use of shared variables in > a tasking environment. These are two different cases. One is when the default is a named object, another is when the default is an anonymous object allocated on the stack. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de