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,FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a00006d3c4735d70 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-23 08:22:58 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!nnx.oleane.net!oleane!teaser.fr!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "amado.alves" Newsgroups: comp.lang.ada Subject: RE: In-Out Parameters for functions Date: Fri, 23 Jan 2004 15:59:51 -0000 Organization: Cuivre, Argent, Or Message-ID: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: melchior.cuivre.fr.eu.org 1074873661 27700 80.67.180.195 (23 Jan 2004 16:01:01 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Fri, 23 Jan 2004 16:01:01 +0000 (UTC) To: Return-Path: X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 content-class: urn:content-classes:message X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: In-Out Parameters for functions Thread-Index: AcPhvBJGO145nltnSxaIc2I7075dVQADFlkj X-OriginalArrivalTime: 23 Jan 2004 16:00:07.0551 (UTC) FILETIME=[F8CF30F0:01C3E1C9] X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.3 Precedence: list List-Id: Gateway to the comp.lang.ada Usenet newsgroup List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:4721 Date: 2004-01-23T15:59:51+00:00 "I don't follow, and I would like to, because I find [IN] OUT params for functions very useful. Could you please elaborate on that a bit more?" Maybe the most common example is the idiom (illegal in Ada): while Next (Item) loop Do_Something (Item); end loop; where the Next function returns false in no more items are available, and Item is an (illegal) in out parameter which holds the result of a 'successful' call (and holds garbage on unsuccessful calls--this is=20 the ugly bit). The above idiom is perhaps the most clean solution for the associated problem. I know I invariably use it when I write in C. (Sorry for the possibly illformatted text.=20 I'm stuck with a crapy webmail system.)