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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder.erje.net!eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!news.uni-weimar.de!medsec1.medien.uni-weimar.de!lucks From: Stefan.Lucks@uni-weimar.de Newsgroups: comp.lang.ada Subject: Re: Gnat 2013 is out! Date: Fri, 31 May 2013 13:30:12 +0200 Organization: Bauhaus-Universitaet Weimar Message-ID: References: <32d94173-533a-471e-95a0-abb73a6cdcc2@googlegroups.com> NNTP-Posting-Host: medsec1.medien.uni-weimar.de Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-68110572-1369999815=:13043" X-Trace: tigger.scc.uni-weimar.de 1369999981 24149 141.54.178.228 (31 May 2013 11:33:01 GMT) X-Complaints-To: news@tigger.scc.uni-weimar.de NNTP-Posting-Date: Fri, 31 May 2013 11:33:01 +0000 (UTC) X-X-Sender: lucks@debian In-Reply-To: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) X-Original-Bytes: 3303 Xref: number.nntp.dca.giganews.com comp.lang.ada:181776 Date: 2013-05-31T13:30:12+02:00 List-Id: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-68110572-1369999815=:13043 Content-Type: TEXT/PLAIN; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Thu, 30 May 2013, Randy Brukardt wrote: > "Adam Beneschan" wrote in message > >> I've always wanted some kind of feature in Ada that would allow a=20 >> caller to provide a "dummy" for OUT parameters, without having to=20 >> declare a new variable. The compiler would allocate a temporary object= =20 >> (and a separate one for each use of a "dummy") and then discard it=20 >> after the call. It wouldn't work well when parameter types are=20 >> 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 =3D> <>); > This has two issues: 1. This won't work if the type of Result is unconstrained, as, e.g., in procedure My_Proc(Obj1, Obj2: String; Result : String); 2. This would sometimes break overload resolution -- which procedure should be called by "My_Proc (Obj1, Obj2, Result =3D> <>);" if there happens to be another procedure in scope, such as procedure My_Proc(Obj1, Obj2: String; Result : Unbounded_String); I'd suggest My_Proc (Obj1, Obj2, Result =3D> String(1 .. 80)); or in general My_Proc (Obj1, Obj2, Result =3D> type Name_of_Type); as syntactic sugar for declare Dummy : Name_Of_Type; begin My_Proc (Obj1, Obj2, Result =3D> type Name_of_Type); end; ------ I love the taste of Cryptanalysis in the morning! ------ --Stefan.Lucks (at) uni-weimar.de, Bauhaus-Universit=E4t Weimar, Germany-- --8323329-68110572-1369999815=:13043--