comp.lang.ada
 help / color / mirror / Atom feed
From: "Kent Paul Dolan" <xanthian@well.com>
Subject: Re: Out parameters in a function
Date: Wed, 17 Apr 2002 21:03:08 +0000 (UTC)
Date: 2002-04-17T21:03:08+00:00	[thread overview]
Message-ID: <c17aa389cd92185898859cb7a01f30a5.48257@mygate.mailgate.org> (raw)
In-Reply-To: ug01ufofm.fsf@gsfc.nasa.gov

"Stephen Leake" <stephen.a.leake.1@gsfc.nasa.gov> 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



  parent reply	other threads:[~2002-04-17 21:03 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-14 18:29 Out parameters in a function Nazgul
2002-04-14 19:45 ` David C. Hoos, Sr.
2002-04-15 10:49 ` John McCabe
2002-04-15 11:51   ` John McCabe
2002-04-15 13:43 ` Steve Doiel
2002-04-15 15:09 ` Ted Dennison
2002-04-16  8:49   ` John McCabe
2002-04-16 10:05     ` Dmitry A. Kazakov
2002-04-16 15:26       ` John McCabe
2002-04-16 19:34         ` Matthew Woodcraft
2002-04-16 20:10           ` Darren New
2002-04-17  1:30             ` Kent Paul Dolan
2002-04-17 16:15               ` Darren New
2002-04-19 17:39               ` Florian Weimer
2002-04-17 13:24             ` Stephen Leake
2002-04-17 16:32               ` Darren New
2002-04-17 21:03               ` Kent Paul Dolan [this message]
2002-04-18 12:14             ` Wolfgang Gellerich
2002-04-18 13:52               ` Dmitry A. Kazakov
2002-04-18 16:28                 ` Darren New
2002-04-17 10:17           ` John McCabe
2002-04-16 19:58         ` Kent Paul Dolan
2002-04-16 20:00         ` Kent Paul Dolan
2002-04-17  4:40           ` Jim Rogers
2002-04-17  5:27             ` Kent Paul Dolan
2002-04-17  5:50             ` Eric G. Miller
2002-04-24  2:45               ` David Thompson
2002-04-19 17:40             ` Florian Weimer
2002-04-19 18:26               ` Jim Rogers
2002-04-19 18:53                 ` Florian Weimer
2002-04-17  7:57           ` Dmitry A. Kazakov
2002-04-17 10:21             ` John McCabe
2002-04-24 17:21             ` Warren W. Gay VE3WWG
2002-04-26  7:32               ` Dmitry A. Kazakov
2002-04-15 16:24 ` Stephen Leake
2002-04-16 13:38   ` Ted Dennison
2002-04-17 11:55 ` Ingo Marks
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox