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 >> 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 => <>); > 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 => <>);" 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 => String(1 .. 80)); or in general My_Proc (Obj1, Obj2, Result => type Name_of_Type); as syntactic sugar for declare Dummy : Name_Of_Type; begin My_Proc (Obj1, Obj2, Result => type Name_of_Type); end; ------ I love the taste of Cryptanalysis in the morning! ------ --Stefan.Lucks (at) uni-weimar.de, Bauhaus-Universität Weimar, Germany--