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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e5eb8ca5dcea2827 X-Google-Attributes: gid103376,public From: Brian Rogoff Subject: Re: Ada OO Mechanism Date: 1999/06/08 Message-ID: #1/1 X-Deja-AN: 487368410 References: <3749E9EC.2842436A@aasaa.ofe.org> <7id2eo$fag@drn.newsguy.com> <3749FF7D.F17CE16A@aasaa.ofe.org> <374AC676.F7AE0772@lmco.com> <7ieuja$5v9@news1.newsguy.com> <7ifd6l$bmf@sjx-ixn1.ix.netcom.com> <1999Jun8.151014.1@eisner> <375D9A3D.E1CCCC63@averstar.com> Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: nntp1.ba.best.com 928904727 208 bpr@206.184.139.136 MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-06-08T00:00:00+00:00 List-Id: On Tue, 8 Jun 1999, Tucker Taft wrote: > Hyman Rosen wrote: > > Also, I stated in an earlier message that I thought not allowing T'Class > > variables in records was not orthogonal, but understandable in light of > > the above. Now, suppose I need a function that returns a pair of values, > > one of which is a T'Class and the other a boolean. Is there a way to do > > this? I can't return a record containing the pair, because I can't have > > such a record. I assume that a procedure with a pair of out parameters > > won't work, because the T'Class variable which receives the output must > > be initialized when declared, and then its tag can't change. So, is there > > a way? > > No. Once you need to combine a class-wide value with something else, > you will have to use the heap explicitly. (I suppose you could > add an "access Boolean" parameter to a function if you wanted to return > a Boolean as well as a class-wide value.) This kind of problem is solved in some languages, like Common Lisp and Dylan, with multiple value return and others, like ML and Haskell, with tuples. Was the prospect of such a mechanism for Ada considered (yes I'm sure :-) and if so why was it rejected? Seeing as Ada has aggregates, it seems to me that multiple value return would also have been a feature. Using access params here to simulate functions with out params looks really ugly to me. -- Brian