comp.lang.ada
 help / color / mirror / Atom feed
From: Marin David Condic <condicma@bogon.pwfl.com>
Subject: Re: Tagged Rep Spec
Date: 1999/06/15
Date: 1999-06-15T00:00:00+00:00	[thread overview]
Message-ID: <37668007.F3BF2DE7@pwfl.com> (raw)
In-Reply-To: 7k5mop$n0i$1@nnrp1.deja.com

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/




  reply	other threads:[~1999-06-15  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-15  0:00 Tagged Rep Spec jsanchor
1999-06-15  0:00 ` Marin David Condic [this message]
1999-06-15  0:00 ` Tom Moran
1999-06-16  0:00   ` jsanchor
1999-06-16  0:00 ` Matthew Heaney
1999-06-25  0:00   ` Robert Dewar
1999-06-28  0:00     ` Marin David Condic
replies disabled

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