comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <mcondic.auntie.spam@acm.org>
Subject: Re: Newbee question
Date: Tue, 17 Dec 2002 10:24:39 -0500
Date: 2002-12-17T15:25:05+00:00	[thread overview]
Message-ID: <atnfkh$96e$1@slb6.atl.mindspring.net> (raw)
In-Reply-To: uvssakrf41lvc3@corp.supernews.com

Randy Brukardt <randy@rrsoftware.com> wrote in message
news:uvssakrf41lvc3@corp.supernews.com...
>
> I strongly disagree. Janus/Ada has rather restrictive limits on
> alignment of composite objects (more than GNAT's), yet we were able to
> use rep. clauses on virtually all of the types imported from Windows in
> Claw. In the few cases where we weren't able to use them directly, we
> used solutions like the ones proposed as solutions to the original
> poster's question. And, I certainly fail to see how anyone is worse off
> with these solutions available than they would be in C. So, people are
> usually better off than C/C++ for controlling representation, and
> occassionally have the same amount of pain.
>

Well, my observations have come about from trying to interface along
communications paths with other things that are not necessarily Ada.
Sometimes things overlap byte, word or longword boundaries. Having a
compiler tell me I can't do that instantly makes the rep-clause useless to
me because the only way I can guarantee that I can handle all the cases that
come up - or ever may come up - is to go to a byte array and start picking
out the bits myself, ala C. Maybe my problems aren't the most common ones,
but it happens enough to make one wish that the rep clause could be used to
arbitrarily overlay a contiguous stream of bits without restrictions - or
you start asking yourself "Why bother having a rep clause?" The C answer is
"We don't have a rep clause - go pick the bits apart yourself." The Ada
answer seems to have been "Here. Let me help you with all that bit
twiddling. But only if you agree not to twiddle all the bits you might want
to twiddle..."

I'll give you the compiler efficiency issues. But that just suggests that
perhaps some other construct is necessary for the language to be able to
express representation and then deal with packing/unpacking. I'd be happy if
I could somehow express the record representation in some manner that let me
put the record on the wire or take the record off the wire and then do some
kind of "Pack/Unpack" operations if I wanted to do anything computational. I
don't have a prepackaged answer, but it is something to think about...

MDC
--
======================================================================
Marin David Condic
I work for: http://www.belcan.com/
My project is: http://www.jast.mil/

Send Replies To: m c o n d i c @ a c m . o r g

    "I'd trade it all for just a little more"
        --  Charles Montgomery Burns, [4F10]
======================================================================





  reply	other threads:[~2002-12-17 15:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-14 15:16 Newbee question Eric Robert
2002-12-14 20:10 ` Jeffrey Carter
2002-12-15  1:49   ` Eric Robert
2002-12-15  4:04     ` James S. Rogers
2002-12-16 10:32       ` John McCabe
2002-12-16 13:28         ` Marin David Condic
2002-12-17  0:31           ` Randy Brukardt
2002-12-17 15:24             ` Marin David Condic [this message]
2002-12-19 10:32               ` Ole-Hjalmar Kristensen
2002-12-15  7:57     ` Pascal Obry
2002-12-15 10:06     ` Jerry van Dijk
2002-12-15 19:04       ` Michal Nowak
2002-12-16 10:33         ` John McCabe
2002-12-16  0:47     ` Eric Robert
2002-12-17  3:23       ` Bill Findlay
2002-12-16 10:28     ` John McCabe
2002-12-17  2:36       ` Eric Robert
2002-12-17  3:24         ` Bill Findlay
2002-12-18  9:37         ` John McCabe
replies disabled

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