comp.lang.ada
 help / color / mirror / Atom feed
From: Marin David Condic <mcondic.nospam@acm.org>
Subject: Re: S'Write and How To Count Bytes
Date: 2000/10/03
Date: 2000-10-03T13:21:44+00:00	[thread overview]
Message-ID: <39D9DD58.86538032@acm.org> (raw)
In-Reply-To: Pine.LNX.4.10.10010031157240.1663-100000@lexis.di.fct.unl.pt

Mario Amado Alves wrote:

> The "bottom line" was very simple: you may define the representation in
> primary storage but not in secondary. This is what the ARM prescribes. I
> also would like to see this changed in Ada20XX.

Not quite. You can get around the whole mess very simply by creating a
Stream_Element_Array of the appropriate size (minus the tag) and overloaying
it on the object of your record type 'class. With the overlay you can compute
checksums and whatever else you need, then blip the overlay down the wire. It
could all be done in a class-wide operation so that it will handle all
descendent types and avoids all the overhead of moving stuff around in memory
and calling a bunch of small subprograms to convert the elementary objects to
stream elements. You're guaranteed that your representation of data in memory
is what you blipped down the wire because you just overlayed memory with a
byte interpretation of it.

The problem comes in when you try to start slamming representation clauses on
tagged record types. You encounter a) problems with freezing rules. b)
problems with alignments on descendent types, c) compiler bugs, d) no
attributes for determining the size/placement of the tag within the record
(implementation dependence is about all this causes) e) compiler obstinance in
refusing to give you what you want.

IMHO, it would work much nicer and more efficiently than relying on the stream
attributes, but you just can't seem to get it to work all the way through.

MDC
--
======================================================================
Marin David Condic - Quadrus Corporation - http://www.quadruscorp.com/
Send Replies To: m c o n d i c @ q u a d r u s c o r p . c o m
Visit my web site at:  http://www.mcondic.com/

    "Giving money and power to Government is like giving whiskey
    and car keys to teenage boys."

        --   P. J. O'Rourke
======================================================================






  reply	other threads:[~2000-10-03  0:00 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-03  0:00 S'Write and How To Count Bytes Mario Amado Alves
2000-10-03  0:00 ` Marin David Condic [this message]
2000-10-03  0:00   ` Rep clause problems, was " tmoran
2000-10-03  0:00     ` Marin David Condic
2000-10-04  0:00       ` Simon Wright
2000-10-06  0:00         ` Marin David Condic
2000-10-07  0:00           ` Simon Wright
  -- strict thread matches above, loose matches on Subject: below --
2000-10-02  0:00 tmoran
2000-10-03  5:21 ` Marin David Condic
2000-09-30  0:00 Marin David Condic
2000-10-01  0:00 ` David C. Hoos, Sr.
2000-10-02  0:00   ` Marin David Condic
2000-10-02  0:00     ` Ted Dennison
2000-10-02  0:00       ` tmoran
2000-10-02  0:00         ` Marin David Condic
2000-10-02  0:00         ` tmoran
2000-10-02  0:00           ` Ted Dennison
2000-10-02  0:00           ` Marin David Condic
2000-10-11  0:00             ` Nick Roberts
2000-10-11  0:00               ` Marin David Condic
2000-10-03  0:00       ` Robert A Duff
2000-10-06  0:00         ` Randy Brukardt
2000-10-07  0:11           ` Ted Dennison
2000-10-06  0:00             ` Randy Brukardt
2000-10-07  0:00             ` Marin David Condic
2000-10-08  0:00               ` Jean-Pierre Rosen
2000-10-09  0:00                 ` Randy Brukardt
2000-10-11  0:00                 ` Marin David Condic
2000-10-02  0:00   ` Dr. Joachim Schr�er
2000-10-02  0:00     ` Marin David Condic
2000-10-06  0:00       ` Charles Hixson
2000-10-02  0:00 ` David C. Hoos, Sr.
2000-10-02  6:58 ` tmoran
2000-10-02  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