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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC 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: Marin David Condic Subject: Re: Tagged Rep Spec Date: 1999/06/15 Message-ID: <37668007.F3BF2DE7@pwfl.com>#1/1 X-Deja-AN: 489905987 Content-Transfer-Encoding: 7bit Sender: condicma@bogon.pwfl.com References: <7k5mop$n0i$1@nnrp1.deja.com> Content-Type: text/plain; charset=us-ascii Organization: Pratt & Whitney Mime-Version: 1.0 Reply-To: diespammer@pwfl.com Newsgroups: comp.lang.ada Date: 1999-06-15T00:00:00+00:00 List-Id: jsanchor@cs5.dasd.honeywell.com wrote: > > Hi all, > > I was wondering. Can a person Rep Spec a tagged record? > Yes, you can apply a representation clause to a tagged record, but there are lots of problems with doing so. First, the method of implementing a tagged record is not specified by the language, so you will see some variance in how it is done from one compiler to another. Does there have to be a tag as part of the record structure? If so, where will the tag be located? How big will it be? So whatever you do, it is going to get implementation dependent. In addition, you have no effective means of controlling (or at least finding out and utilizing) the representation of the tag, so you can't guarantee where it is going to be when you want to strip out the part of the record that is really of interest to you. And just in case that isn't complicated enough, you may find that when you get to the child records of a tagged record with a representation clause, you may be limited in placement of their fields. For example, the implementation may insist on aligning child fields on a longword boundary, effectively inserting unused space between the parent fields and the child fields. There may be ways to flog the compiler into submission, but so far, I have not found any. Tagged records would be a very natural representation of some of the communication capabilities I work with, but the inability to *really* control the representation has kept me from exploiting them much. Maybe the compiler writers can 'splain it up to me and get my mind right, but I don't see how it is useful to have a representation clause capability for a type when it doesn't matter what you ask for because you're going to get what the compiler felt like giving you anyway. Sort of like a nasty waitress in a diner where no matter what you order, she is going to bring you eggs over easy and dry white toast. ;-) MDC -- Marin David Condic Real Time & Embedded Systems, Propulsion Systems Analysis United Technologies, Pratt & Whitney, Large Military Engines M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600 ***To reply, remove "bogon" from the domain name.*** Visit my web page at: http://www.mcondic.com/