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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,48bbfdbc3683ed X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Tagged Rep Spec Date: 1999/06/16 Message-ID: #1/1 X-Deja-AN: 490324296 References: <7k5mop$n0i$1@nnrp1.deja.com> NNTP-Posting-Date: Wed, 16 Jun 1999 10:14:26 PDT Newsgroups: comp.lang.ada Date: 1999-06-16T00:00:00+00:00 List-Id: On 15 Jun 1999 14:08, jsanchor@cs5.dasd.honeywell.com wrote: > I was wondering. Can a person Rep Spec a tagged record? The correct term is rep "clause." Although the RM allows you to specify a rep clause for a tagged type, I don't see the point, since you don't know 1) how big the tag is 2) if the compiler needs the tag to be placed at a specific offset 3) if there even is a tag If you need to transmit this data across an external interface, then use the streams facility. That way you won't have to go mucking around with non-portable, ill-defined rep clauses. If you don't need type extension for this abstraction, then don't bother making the type tagged. Not every type needs to be a tagged type. > Type Interrupt_Record_Type is tagged > Record > watchdog_warning : boolean; > utility_clock : boolean; > timer1 :boolean; > rs232 :boolean; > mailbox :boolean; > end record; > > for Interrupt_Record_Type use > record > watchdog_warning at 0 range 0..0; > utility_clock at 0 range 1..1; > timer1 at 0 range 2..2; > rs232 at 0 range 3..3; > mailbox at 0 range 4..4; > end record; This looks like it doesn't need to be tagged, as it seems low-level.