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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,21321460863e2689 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: Why parameter passing by copy? Date: 2000/05/28 Message-ID: <8gpqeg$ost$1@nnrp1.deja.com>#1/1 X-Deja-AN: 628105815 References: X-Http-Proxy: 1.0 x65.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Sun May 28 00:49:24 2000 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) Date: 2000-05-28T00:00:00+00:00 List-Id: In article , "Pat Rogers" wrote: > Passing things by copy precludes aliasing, which can lead to > nasty > surprises. For scalars there is no speed penalty so the > language > mandates it for the safety aspect. Actually, historically it is at least as much a concern for efficiency. Everyone recognized that call by copy is more efficient. It is certainly true that once you have decided that call by copy is more efficient, it is also a nice benefit that it is cleaner semantically. Note that Ada is definitely concerned with efficiency over avoiding aliasing. We can tell that with objects other than scalars, where we accept not just call by reference, but implementation dependence, in an effort to maximize efficiency. Basically Ada took the same approach as Fortran in this regard. Sent via Deja.com http://www.deja.com/ Before you buy.