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.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cc9d51d301f523ef X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-17 07:25:09 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!snoopy.risq.qc.ca!newsfeed.news2me.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: Newbee question Date: Tue, 17 Dec 2002 10:24:39 -0500 Organization: MindSpring Enterprises Message-ID: References: <3DFB9067.2040600@acm.org> <0dRK9.37601$xH3.400905@weber.videotron.net> <2bTK9.62545$hK4.5163007@bgtnsc05-news.ops.worldnet.att.net> <3dfdab08.5187148@news.demon.co.uk> NNTP-Posting-Host: d1.56.b5.ee X-Server-Date: 17 Dec 2002 15:25:05 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Xref: archiver1.google.com comp.lang.ada:31959 Date: 2002-12-17T15:25:05+00:00 List-Id: Randy Brukardt 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] ======================================================================