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=0.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,75a8a3664688f227 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-06 20:02:18 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!newsfeed.berkeley.edu!ucberkeley!blanket.mitre.org!newsfeed.mathworks.com!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Robert Dewar Newsgroups: comp.lang.ada Subject: Re: Parameter Modes, In In Out and Out Date: Sun, 07 Jan 2001 03:51:28 GMT Organization: Deja.com Message-ID: <938p3u$omv$1@nnrp1.deja.com> References: <7Cx56.90736$A06.3322588@news1.frmt1.sfba.home.com> <937jab$s23$1@nnrp1.deja.com> <3A57CD7F.2228BFD5@brighton.ac.uk> NNTP-Posting-Host: 205.232.38.14 X-Article-Creation-Date: Sun Jan 07 03:51:28 2001 GMT X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; U) X-Http-Proxy: 1.0 x53.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 X-MyDeja-Info: XMYDJUIDrobert_dewar Xref: supernews.google.com comp.lang.ada:3735 Date: 2001-01-07T03:51:28+00:00 List-Id: In article <3A57CD7F.2228BFD5@brighton.ac.uk>, John English wrote: > I prefer to consider parameter passing by copy-and-return > rather than by-reference as the norm (even though it applies > to fewer situations in practice) But unfortunately, this model is just wrong for by-reference types. Especially in object oriented programming, where all tagged types are passed by reference, it is quite wrong to regard the input as uninitialized, since this does not correspond with the semantics of the language. For example, one can imagine a situation in which some field of an object serves merely as a kind of logical "tag", and it makes sense to read it, just as it makes sense to read the real tag, and bounds information. You might decide that logically it is reasonable to consider a parameter to be be an OUT parameter if the routine only reads this logical tag field, but initializes all the other fields. The treatment in Ada 95 is different from Ada 83 in this area, you need to readjust thinking a bit :-) Sent via Deja.com http://www.deja.com/