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: 11232c,bde6489d2ec79329 X-Google-Attributes: gid11232c,public X-Google-Thread: 103376,9245b8db9abd376c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-24 10:22:12 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!news-out.newsfeeds.com!propagator2-maxim!propagator-maxim!news-in.spamkiller.net!feed.newsfeeds.com!feed.cgocable.net!feed.tor.primus.ca!feed.nntp.primus.ca!newsfeed.torontointernetxchange.net!radon.golden.net!news1.tor.metronet.ca!nnrp1.tor.metronet.ca!not-for-mail Message-ID: <3CC6E99F.3000603@home.com> From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada,misc.misc Subject: Re: Out parameters in a function References: <4519e058.0204150709.55c94dfb@posting.google.com> <3cbbe583.3628858@news.demon.co.uk> <3cbc3f05.26543327@news.demon.co.uk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 24 Apr 2002 17:21:37 GMT NNTP-Posting-Host: 198.96.47.195 NNTP-Posting-Date: Wed, 24 Apr 2002 11:21:37 MDT Organization: MetroNet Communications Group Inc. Xref: archiver1.google.com comp.lang.ada:23065 misc.misc:6853 Date: 2002-04-24T17:21:37+00:00 List-Id: Dmitry A. Kazakov wrote: > On Tue, 16 Apr 2002 20:00:42 +0000 (UTC), "Kent Paul Dolan" > wrote: ... > Same in Ada: > > declare > aSomestructTypedVariable : constant SomestructType := > aSomestructReturningFunction (...); > begin > if aSomestructTypedVariable.booleanPart then > usefulVal := aSomestructTypedVariable.usefulPart; > end if; > end; You could take this one step further (or perhaps this is implied) and make the returned "SomestructType" a discriminated type. That way if the value .booleanPart is false, the other member(s) of the record/structure is invalid to access, maintaining safety. ... > Regards, > Dmitry Kazakov > www.dmitry-kazakov.de -- Warren W. Gay VE3WWG http://home.cogeco.ca/~ve3wwg