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,9245b8db9abd376c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-17 06:35:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Out parameters in a function Date: 17 Apr 2002 09:24:29 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <3cbbe583.3628858@news.demon.co.uk> <3cbc3f05.26543327@news.demon.co.uk> <3CBC855D.148232E3@san.rr.com> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1019050246 23771 128.183.220.71 (17 Apr 2002 13:30:46 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 17 Apr 2002 13:30:46 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:22654 Date: 2002-04-17T13:30:46+00:00 List-Id: Darren New writes: > > > RESULT high, low > > h, l := split.int16 (365) > > Note that in virtually all these languages, what this means is "return > an anonymous tuple from the function." AFAIK, FORTH is the only > reasonably common language where you can *actually* return multiple > values from a function, rather than returning a single structured value. What is the difference between an "anonymous tuple" and "multiple values"? That's how I would _define_ "anonymous tuple"! In Forth, I can push several values on the stack, and then return from the word (it's _not_ a "function", it's a "word" :). In Ada, I can set several values in the return type, and then return. I don't see that the difference is significant. The syntax is different, but not the semantics. Hmm. In Forth I can decide at run time how many values to push on the stack. I can do that in Ada with an unconstrained array; not quite as flexible, but way safer :). -- -- Stephe