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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,a00006d3c4735d70 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-23 10:02:50 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!proxad.net!proxad.net!213.56.31.76.MISMATCH!nnx.oleane.net!oleane!nnrp.oleane.net!skymaster!nobody From: "Jean-Pierre Rosen" Newsgroups: comp.lang.ada Subject: Re: In-Out Parameters for functions Date: Fri, 23 Jan 2004 19:02:23 +0100 Organization: Adalog Message-ID: <1knrub.i77.ln@skymaster> References: NNTP-Posting-Host: mailhost.axlog.fr X-Trace: s1.read.news.oleane.net 1074880971 11643 195.25.228.57 (23 Jan 2004 18:02:51 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Fri, 23 Jan 2004 18:02:51 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Xref: archiver1.google.com comp.lang.ada:4733 Date: 2004-01-23T19:02:23+01:00 List-Id: "amado.alves" a �crit dans le message de news:mailman.7.1074873660.2270.comp.lang.ada@ada-france.org... >"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; I understand pros and cons of in out for functions, but this one is really not convincing. I always write: while More_To_Come loop Get (Item); Do_Something (Item); end loop; Of course, Get raises an exception if there are no more items available, so it is a lot more secure. Well, of course, security and exceptions are not an issue when you program in C... -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr