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-17 14:03:09 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 21:03:08 +0000 (UTC) Organization: Mailgate.ORG Server - http://www.Mailgate.ORG Message-ID: References: <3cbbe583.3628858@news.demon.co.uk> <3cbc3f05.26543327@news.demon.co.uk> <3CBC855D.148232E3@san.rr.com> NNTP-Posting-Host: 198.207.153.205 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.mailgate.org 1019077366 32607 198.207.153.205 (Wed Apr 17 23:03:07 2002) X-Complaints-To: abuse@mailgate.org NNTP-Posting-Date: Wed, 17 Apr 2002 21:03:08 +0000 (UTC) Injector-Info: news.mailgate.org; posting-host=198.207.153.205; posting-account=48257; posting-date=1019077366 User-Agent: Mailgate Web Server X-URL: http://mygate.mailgate.org/mynews/comp/comp.lang.ada/c17aa389cd92185898859cb7a01f30a5.48257%40mygate.mailgate.org Xref: archiver1.google.com comp.lang.ada:22677 misc.misc:6499 Date: 2002-04-17T21:03:08+00:00 List-Id: "Stephen Leake" wrote: > 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. Yes. In Java, the Enumeration provides a similar facility for returning a (possibly mixed, if they were hooked that way in the container from which the Enumeration is derived) bag of objects which it will then regurgitate one by one as requested; since they can be of Java's essentially anonymous type "Object", it is up to the recipient or to an agreement between producer and consumer to sort out what is what. So, in comparision to Darren's model for Forth, in Java, you do "hook, hook, hook, create Enumeration, return Enumeration, receive Enumeration, unhook, unhook, unhook"; same result, different details. xanthian. Unfortunately it would _not_ support the C model of using the third thing hooked as a boolean to a conditional before accessing the first and second things hooked. Strictly FIFO, so far as I can tell. Thus it wouldn't satisfy the original request. -- Posted via Mailgate.ORG Server - http://www.Mailgate.ORG