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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f3437064e1091fec X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-11 16:06:38 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!usenet-fr.net!enst.fr!not-for-mail From: "Beard, Frank Randolph CIV" Newsgroups: comp.lang.ada Subject: RE: What evil would happen? Date: Fri, 11 Jul 2003 19:04:29 -0400 Organization: ENST, France Message-ID: NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: avanie.enst.fr 1057964726 80005 137.194.161.2 (11 Jul 2003 23:05:26 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Fri, 11 Jul 2003 23:05:26 +0000 (UTC) To: Return-Path: X-MimeOLE: Produced By Microsoft Exchange V6.0.5762.3 content-class: urn:content-classes:message X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: What evil would happen? Thread-Index: AcNH6ho/K03ZD+zIRAaqsygkFgMa4gAFnssQ X-OriginalArrivalTime: 11 Jul 2003 23:04:29.0985 (UTC) FILETIME=[C8A34910:01C34800] X-Scanned-By: MIMEDefang 2.1 (www dot roaringpenguin dot com slash mimedefang) X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: comp.lang.ada mail to news gateway List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:40215 Date: 2003-07-11T19:04:29-04:00 -----Original Message----- From: Hyman Rosen >Wojtek Narczynski wrote: >> What would happen if a procedure could return a value like a = function, >> or a function could accept an out parameter? > I don't know Ada well enough to answer this myself, > so I'll ask here - can you make a generic function > with generic parameters which correspond to the out > parameters that you would like to pass into the > function, and have the function write to those? If > so, is that an acceptable workaround? Well, if you really wanted the C/C++ function characteristics for whatever reason, you could use aliased types and pass them as access parameters to the function. type X_Type is ... function Do_Something (to_X : access X_Type) return integer; function Do_Something (to_X : access X_Type) return integer is begin ... to_X.all :=3D ...; -- update to_X ... return 0; exception when others =3D> return -1; end Do_Somthing; x : aliased X_Type; return_Code : integer :=3D 0; begin ... return_Code :=3D Do_Something(to_X =3D> x'access); ... Sorry I didn't have time to come up with something more concrete, but hopefully you get my meaning. Hope it helps. Frank