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-16 22:27:15 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.mailgate.org!mygate.mailgate.org!198.207.153.205!not-for-mail From: "Kent Paul Dolan" Newsgroups: comp.lang.ada,misc.misc Subject: Re: Out parameters in a function Date: Wed, 17 Apr 2002 05:27:14 +0000 (UTC) Organization: Mailgate.ORG Server - http://www.Mailgate.ORG Message-ID: <27d08a4ae43640b7384ac285cf0983b5.48257@mygate.mailgate.org> References: <4519e058.0204150709.55c94dfb@posting.google.com> <3cbbe583.3628858@news.demon.co.uk> <3cbc3f05.26543327@news.demon.co.uk> <3CBCFCC8.6000206@worldnet.att.net> NNTP-Posting-Host: 198.207.153.205 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.mailgate.org 1018998135 26949 198.207.153.205 (Wed Apr 17 07:27:14 2002) X-Complaints-To: abuse@mailgate.org NNTP-Posting-Date: Wed, 17 Apr 2002 05:27:14 +0000 (UTC) Injector-Info: news.mailgate.org; posting-host=198.207.153.205; posting-account=48257; posting-date=1018998135 User-Agent: Mailgate Web Server X-URL: http://mygate.mailgate.org/mynews/comp/comp.lang.ada/27d08a4ae43640b7384ac285cf0983b5.48257%40mygate.mailgate.org Xref: archiver1.google.com comp.lang.ada:22636 misc.misc:6435 Date: 2002-04-17T05:27:14+00:00 List-Id: "Jim Rogers" wrote: > Well, almost. C does not have a boolean type. Sorry, of course you're correct. The standard C include files have defined TRUE and FALSE for so long and I've used them for so long I tend to forget they aren't, per se, part of C, but just some of those programming "implicit contracts" spoken of in another thread. [And my usual usage before they came along was always: #define TRUE ( 0 == 0 ) #define FALSE ( 0 == 1 ) anyway, since I didn't want to be dependent on a particular compiler writer's picking the usual choice of treatments of 0 versus non-zero as true or false, which I should have remembered.] > C (since its first > ANSI standard) does support returning structures. It could always > return a pointer to a structure. > Ada does not have the same sense of expressions as C. > Specifically, an assignment operator in Ada does not return a value. That is probably both good and bad; good, because stack cleanups or alternate compilation paths for unused optionally produced values aren't an issue; in this case unfortunate, since it prevents a fairly natural way to accomplish what the original poster was seeking. Not that the obvious way of breaking the suggestion I presented down into several steps won't work, it is just much more awkward than using value-providing assignment statements or polyadic valued functions. Thanks for the corrections and further advice. > Jim Rogers xanthian, happiest probably programming in languages where one can return a list of values from a procedure. -- Posted via Mailgate.ORG Server - http://www.Mailgate.ORG