comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org>
Subject: Re: Behavior of Stream Attributes On Access Types.
Date: Mon, 17 Jun 2002 10:31:59 -0400
Date: 2002-06-17T14:32:01+00:00	[thread overview]
Message-ID: <aekrt1$a1$1@nh.pace.co.uk> (raw)
In-Reply-To: ugnu54b8nr87aa@corp.supernews.com

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" <randy@rrsoftware.com> 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.
>
>
>
>





  reply	other threads:[~2002-06-17 14:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-10 19:38 Behavior of Stream Attributes On Access Types Marin David Condic
2002-06-11  5:33 ` R. Tim Coslet
2002-06-11 14:15   ` Marin David Condic
2002-06-11 13:47 ` Ted Dennison
2002-06-11 14:27   ` Marin David Condic
2002-06-11 14:37     ` Marin David Condic
2002-06-12 14:19       ` David C. Hoos
2002-06-12 15:18         ` Marin David Condic
2002-06-13  3:00           ` David C. Hoos, Sr.
2002-06-14 18:27           ` Simon Wright
2002-06-14 18:53             ` Marin David Condic
2002-06-15 14:56               ` Simon Wright
2002-06-16  2:27                 ` Randy Brukardt
2002-06-17 14:31                   ` Marin David Condic [this message]
2002-06-18 19:30                     ` Randy Brukardt
2002-06-12 19:39       ` Randy Brukardt
2002-06-12 13:31     ` Ted Dennison
2002-06-11 21:56   ` Randy Brukardt
2002-06-12  3:44 ` David C. Hoos, Sr.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox