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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,342dcd67e9ca73ee X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!g43g2000cwa.googlegroups.com!not-for-mail From: "Hyman Rosen" Newsgroups: comp.lang.ada Subject: Re: tagged record child: override constructor? Date: 16 Sep 2005 14:33:45 -0700 Organization: http://groups.google.com Message-ID: <1126906425.359022.289440@g43g2000cwa.googlegroups.com> References: <1126625009.709876.226260@f14g2000cwb.googlegroups.com> <225337460.SlYKbeB8eD@linux1.krischik.com> <87vf14him5.fsf@ludovic-brenta.org> <1idpvzxcxfckw.mrs8nw3eu4ks$.dlg@40tude.net> <13wyu4lwsmzmz.ktc3t2av54yv$.dlg@40tude.net> <1126705974.984997.227590@z14g2000cwz.googlegroups.com> <1126718176.448703.193860@g44g2000cwa.googlegroups.com> <1aroipmwspnb8.zqxtxhb4t06u$.dlg@40tude.net> <1126731371.081850.90860@g44g2000cwa.googlegroups.com> <12v93t1k4i81i$.sm5jmg8q3lpk$.dlg@40tude.net> <1126790380.573573.78220@g44g2000cwa.googlegroups.com> <1w82ustqd4vak$.mv9c3tcxa6sx.dlg@40tude.net> <1126810455.448696.262570@g44g2000cwa.googlegroups.com> <1126882356.112798.288440@g14g2000cwa.googlegroups.com> <93g4w5iedrdj.qjv8pbklcryx$.dlg@40tude.net> NNTP-Posting-Host: 204.253.248.208 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1126906430 17488 127.0.0.1 (16 Sep 2005 21:33:50 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 16 Sep 2005 21:33:50 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 (No IDN) Firefox/1.0.6,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g43g2000cwa.googlegroups.com; posting-host=204.253.248.208; posting-account=lJDDWg0AAACmMd7wLM4osx8JUCDw_C_j Xref: g2news1.google.com comp.lang.ada:4812 Date: 2005-09-16T14:33:45-07:00 List-Id: Dmitry A. Kazakov wrote: > Why do you think so? The program semantics should be independent from the > parameter passing mode. If tagged types were not passed by reference then the program semantics would be severely affected. That's why the language requires that passing mode. But in that case, it should be part of the program, not a hidden requirement. > You cannot have a reference to a specific type. Same with pointers. True (for class types). > Further, because > T& is not an object, you cannot do such elementary thing as to copy a > polymorphic object. No, that's not why. It's purely the pragmatic implementation complexity of arranging for the space and copying of an object of runtime-determined size. Even in Ada objects of T'Class type are somewhat half-baked. They can't live inside records, you can't have arrays of them, etc. > No. It is the class rooted in the type which do. A T'Class serves as a > closure of all types derived from T. > A view conversion is still a conversion. When I view convert from a derived class type to a base class type, and then back again, I have the same contents (and the same object) that I started with. The extra derived stuff cannot magically appear from nowhere; therefore it must have been there all along. Therefore even though I have an object of some declared type I know that it may be carrying along a bunch of extra data.