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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1a52c822fc0dbb23 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newspeer.monmouth.com!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Rational for not making cursor tagged in Containers Date: Thu, 19 Apr 2007 16:45:36 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1176998738.656903.141250@q75g2000hsh.googlegroups.com> <1177010938.200523.325290@p77g2000hsh.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1177015537 24763 192.74.137.71 (19 Apr 2007 20:45:37 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 19 Apr 2007 20:45:37 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:MKd7zXqwjSSAzdEG5U7dBp4sCkU= Xref: g2news1.google.com comp.lang.ada:15127 Date: 2007-04-19T16:45:36-04:00 List-Id: Anh Vo writes: > On Apr 19, 11:25 am, Robert A Duff > wrote: >> >> I suppose it's because there's no need for type extension or dispatching >> calls. So why pay the overhead? > > Well, I have not yet come across the situation where a Container type > needs to be extended. And yet, overhead was already paid. True. I think the rationale is that container types typically need finalization, so they need to be derived from Controlled, so they are tagged. It was not necessary to make them VISIBLY tagged, but I think the idea was "why not?". You're paying for the tag anyway, whether or not it's in the visible part. That leads to the question, why can't we have untagged types with finalization? The answer is that during Ada 9X, the derive-from-controlled idea was thought to be the simplest. And finalization almost didn't make it into Ada 95. >> A different question might be: Why is the prefix notation not allowed >> for untagged types? I don't know the answer to that, but it's probably >> documented in the relevant AI. > > Then, it is not an extended (objectable) type. I will look for it. And another question: why can't untagged types be extended? That was allowed in the original design for Ada 9X. Tags are needed for dispatching, but they are not needed for extension. >> I'm not a big fan of prefix notation, by the way. > > It is not uncommon that different people have different thinking. For > me prefixed notation clearly has advantages. Of course, I like to use > them to the fullest :-) There is an advantage: If you have type P1.T1, with operation Mumble, and P2.T2 extends P1.T1, and X is of type T2, do I say "P1.Mumble(X, ...)", or "P2.Mumble(X, ...)"? It's confusing, because it depends whether Mumble is class-wide or dispatching, which is a conceptually minor distinction. And it's not unusual to change from dispatching to class-wide. The notation "X.Mumble(...)" avoids that confusion. Nonetheless, it just seems weird to me to pretend that Mumble is inside X, like a component. There must be a better way. - Bob