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,af42f89f2159f3b6 X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: A note on GNAT 3.05 performance Date: 1996/06/24 Message-ID: #1/1 X-Deja-AN: 162548889 references: <4qm21c$qig@mdnews.btv.ibm.com> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-06-24T00:00:00+00:00 List-Id: Dale said When I first began looking at Ada, I wondered if if was 'pass by value' or 'pass by reference'. The answer was, apparently, 'neither and both'. It seemed to me that Ada was attempting to 'idealize' a concept by using copy-in/copy-out that it shouldn't be. Ada was not doing anything new here. Fortran has also always had an implementation defined choice between pass by reference and pass by copy for exactly the same reason (efficiency). Now maintaining copy-in and copy-out will apparently have a performance penalty, yet changing that aspect to pass-by-reference will not be consistant with regular 'in' parameter passing. Regular in parameter passing allows records to be passed by copy or reference, so there is no inconsistency here. The issue was being consistent with C by default, there is no problem at the Ada semantic level. Are Ada pragmas frozen in concrete the way the rest of the language is? Is it feasible to make 'pass by copy' and 'pass by reference' for record parameters adjustable on a pragma basis? Is it desirable? New pragmas can be added (see the features file in the GNAT distribution for many interesting ones added to GNAT). We will be implementing all the Dec pragmas in the near future, which among other things allow this level of control. Of course the use of pragma Convention (or Import or Export) will in practice control the choice of record passing semantics.