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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f32236e7e55b02e0 X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: Ada Queue Date: 2000/04/07 Message-ID: <8cldq0$bvt$1@nnrp1.deja.com>#1/1 X-Deja-AN: 607987957 References: <38eca724@news.hamilton.edu> <8ciesn$4mt$1@nnrp1.deja.com> <38ecc752@news.hamilton.edu> <8cisft$jtg$1@nnrp1.deja.com> <38ed0123@news.hamilton.edu> <38edcbf2@news.hamilton.edu> X-Http-Proxy: 1.0 x35.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Fri Apr 07 19:44:04 2000 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; I) Date: 2000-04-07T00:00:00+00:00 List-Id: In article <38edcbf2@news.hamilton.edu>, "Joseph T" wrote: > > >It would perhaps have been clearer for the reader to use a temporary > >variable to iterate, but there are no other drawbacks associated with > >his method, which is indeed a very common way of doing it in C. > > Which method is a common way of doing it in C? Using the temporary > variable to iterate or not? In C all parameters are passed by copy-in. That means that *both* the local variable and the parameter can be considered "temporaries". Neither get passed back to the user, only the object of the "return" goes back. So really either is just as good. But for your Ada code you (quite reasonably) used an "in out" parameter. But that means *any* assignment to that parameter potentially goes out to the user. This is a very different situation. -- T.E.D. http://www.telepath.com/~dennison/Ted/TED.html Sent via Deja.com http://www.deja.com/ Before you buy.