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-11 13:36:02 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!falcon.america.net!news.minn.net!newsfeed.mesh.ad.jp!nntp1.njy.teleglobe.net!teleglobe.net!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newspeer.monmouth.com!news-feeds!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: mark_lundquist@my-deja.com Newsgroups: comp.lang.ada Subject: Re: Parameter Modes, In In Out and Out Date: Thu, 11 Jan 2001 21:24:24 GMT Organization: Deja.com Message-ID: <93l89r$r9m$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> <938p3u$omv$1@nnrp1.deja.com> <93cagm$c1j$1@nnrp1.deja.com> NNTP-Posting-Host: 130.213.203.244 X-Article-Creation-Date: Thu Jan 11 21:24:24 2001 GMT X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt) X-Http-Proxy: 1.1 x57.deja.com:80 (Squid/1.1.22) for client 130.213.203.244 X-MyDeja-Info: XMYDJUIDmark_lundquist Xref: supernews.google.com comp.lang.ada:3927 Date: 2001-01-11T21:24:24+00:00 List-Id: In article <93cagm$c1j$1@nnrp1.deja.com>, dmitry6243@my-deja.com wrote: > In article <938p3u$omv$1@nnrp1.deja.com>, > Robert Dewar wrote: > > 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. > > OOP does not enforce "tagged types" to be passed by reference. This is > Ada 95 specific. Only class-wide types shall be passed by reference (for > their size is unknown). "tagged type" is an Ada locution -- when Robert uses it, you know he is talking about Ada! So I think he meant something like, "...in object oriented Ada programming where you are using tagged types, it is quite wrong to regard the parameter as uninitialized, since tagged types are always passed by reference"! > > Maybe I am wrong, but it seems that RM does not forbid to keep the type > tag separated from the value. Does it? No, it doesn't; it's just that the tag is not "part of" the value (regardless of where it is "kept"). > > Anyway the clear distinction of normal types and class-wide types is an > excellent (revolutionaly, IMO) concept. It is pity that Ada 95 didn't > use all advantages of the concept. For instance, to have multiple > dispatch, or even, all types "tagged"! Interesting idea, but I don't know that I agree it's "a pity" that Ada didn't do these things. Ada is a practical language. Making scalars, etc. carry a tag around wouldn't be worth it. It would really foul up system-level programming and interfacing to other languages. I don't see a whole lot of value in doing classwide programming on integers or arrays anyway (with plenty of opportunity for obscure code). Can't you get the same effect by declaring a tagged container, then deriving from that? Use a tagged record if you want taggedness... simple, there's no loss of power there... -- mark Sent via Deja.com http://www.deja.com/