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.9 required=5.0 tests=BAYES_00 autolearn=ham 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-09 05:35:17 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!elnk-pas-nf1!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!newsread1.news.atl.earthlink.net.POSTED!d9c68f36!not-for-mail Message-ID: <3FFEAE10.3070209@noplace.com> From: Marin David Condic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 (OEM-HPQ-PRS1C03) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: In-Out Parameters for functions (was: Re: Certified C compilers for safety-critical embedded systems References: <3fe00b82.90228601@News.CIS.DFN.DE> <5802069.JsgInS3tXa@linux1.krischik.com> <1072464162.325936@master.nyc.kbcfp.com> <1563361.SfB03k3vvC@linux1.krischik.com> <11LvOkBBXw7$EAJw@phaedsys.demon.co.uk> <3ff0687f.528387944@News.CIS.DFN.DE> <1086072.fFeiH4ICbz@linux1.krischik.com> <3ff18d4d.603356952@News.CIS.DFN.DE> <1731094.1f7Irsyk1h@linux1.krischik.com> <3ff1b8ef.614528516@News.CIS.DFN.DE> <3FF1E06D.A351CCB4@yahoo.com> <3ff20cc8.635997032@News.CIS.DFN.DE> <3ff9df16.30249104@News.CIS.DFN.DE> <3FFC0201.6020303@noplace.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 09 Jan 2004 13:35:17 GMT NNTP-Posting-Host: 165.247.64.122 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.atl.earthlink.net 1073655317 165.247.64.122 (Fri, 09 Jan 2004 05:35:17 PST) NNTP-Posting-Date: Fri, 09 Jan 2004 05:35:17 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:4255 Date: 2004-01-09T13:35:17+00:00 List-Id: Yeah, but as far as I can tell C always had "in only" parameters and everything was a function returning a result. The only way you could get "in out" mode was passing addresses (indistinguishable to the garden variety programmer from a 'Access) and of course dealing with all the errors that resulted from no checking that a parameter actually was an address. Such a setup didn't seem to hurt C with respect to popularity or getting Fortran programmers to understand it. I'm ambivalent about "in out" for functions. I've never found it difficult to use functions just the way they are and can't think of a case where in-out would have helped me with a real world problem. The only example anyone ever seems to cite is the Random Number Generator leading me to think that maybe this *is* the only instance in which it is genuinely useful. OTOH, I could see how they might be included and not impact my life one iota. If you don't need it, you don't use it. Except that possibly it casts into doubt what happens in an expression loaded with function calls where one used to be able to assume that the parameters were not being modified. With in-out you'd have to know the parameter modes before you could interpret what the expression was doing. MDC Robert A Duff wrote: > > As far as I can remember, this idea was considered, and was generally > thought to be ugly. I mean, suppose you're trying to convince a Fortran > programmer to use Ada for numerics stuff. If you start babbling about > aliased and 'Access when there is no inherent need for pointers, > they're going to laugh, and rightly so. > -- ====================================================================== Marin David Condic I work for: http://www.belcan.com/ My project is: http://www.jsf.mil/NSFrames.htm Send Replies To: m o d c @ a m o g c n i c . r "Face it ladies, its not the dress that makes you look fat. Its the FAT that makes you look fat." -- Al Bundy ======================================================================