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.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6bf481efd29cf77b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-18 03:51:20 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!195.238.2.15!skynet.be!skynet.be!news-x2.support.nl!psinet-eu-nl!psiuk-p4!uknet!psiuk-p3!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: Behavior of Stream Attributes On Access Types. Date: Mon, 17 Jun 2002 10:31:59 -0400 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: References: <4519e058.0206110547.526d2369@posting.google.com> NNTP-Posting-Host: dhcp-200-133.miami.pace.co.uk X-Trace: nh.pace.co.uk 1024324321 321 136.170.200.133 (17 Jun 2002 14:32:01 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 17 Jun 2002 14:32:01 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:26226 Date: 2002-06-17T14:32:01+00:00 List-Id: O.K. *THAT* is the part I was looking for. (I don't think this was in your original answer.) Type A uses the default 'Write. Type B descending from A overrides 'Write to do its own thing. Type C descending from B and adding new fields NEED NOT override 'Write - it will first call type B's 'Write and then will call 'Write for any new fields added. At least that is the behavior that *SHOULD* be there, correct? (If it doesn't call the 'Write for the additional fields, you'd be stuck having to override it.) It is a confusing issue & I'm glad I now have a good answer. As you indicate that it may not be this way in all compilers, I guess one needs to test it out & verify that it works. Too bad - I could see it being a serious portability issue in that one might easily write code as I described above. I suppose that from a stylistic perspective it would be better to override the 'Read and 'Write for the individual fields, but I could easily imagine a situation where the reason for overriding them is to control representation of the overall record. (Suppose I need to make sure that some fields aren't padded within the record - then subsequent extensions to it I might not care because I'm happy with the default behavior.) Thanks for the info. MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com "Randy Brukardt" wrote in message news:ugnu54b8nr87aa@corp.supernews.com... > > To expand a bit further, the TC requires that the default implementation > calls the parent type's 'Read and 'Write, along with the 'Read and > 'Writes for any extension components. So you don't have to do anything > special, and you should get what you expect. But, again, be sure that > your compiler implements the TC before depending on this! (If it doesn't > implement the TC, it could do just about anything; the original Ada 95 > standard is very confused when it comes to streams and stream > attributes). > > Randy Brukardt. > > > >