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: Tucker Taft Subject: Re: Ada OO Mechanism Date: 1999/06/09 Message-ID: <375E92CB.27850620@averstar.com>#1/1 X-Deja-AN: 487542627 Content-Transfer-Encoding: 7bit Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com 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 Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-06-09T00:00:00+00:00 List-Id: Brian Rogoff wrote: > ... > 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. In Ada, multiple value return is not significantly different from returning a record. However, the problem we are trying to solve is not multiple value return, but rather returning objects of size unknown at compile-time without using the heap. Common Lisp, Dylan, ML, and Haskell all rely heavily on heap-based mechanism, and what is passed around are references (or tuples of references). References, and records or arrays of references, are no problem in Ada either. The challenge is to avoid the heap, and I believe Ada goes further than almost any language in accomplishing that. But as pointed out, there are some limitations, which result in the heap being necessary when things get too complicated. > Using access params here to simulate functions with out params looks really > ugly to me. Access parameters are the Ada 95 way to give functions "out" parameters. It has the advantage of making the OUT parameters quite visible, thanks to the use of 'Access at the call point. Note that many languages don't support OUT parameters at all. All they support is passing references. > -- Brian -- -Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ Technical Director, Distributed IT Solutions (www.averstar.com/tools) AverStar (formerly Intermetrics, Inc.) Burlington, MA USA