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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,38159b1b5557a2e7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-25 08:38:57 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!newsread1.news.atl.earthlink.net.POSTED!d9c68f36!not-for-mail Message-ID: <4013F11E.4030700@noplace.com> From: Marin David Condic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 (OEM-HPQ-PRS1C03) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Standard Ada Preprocessor References: <401272E3.4040506@noplace.com> <8LzQb.12619$U%5.77885@attbi_s03> <4012D932.9010509@noplace.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 25 Jan 2004 16:38:56 GMT NNTP-Posting-Host: 209.165.23.132 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.atl.earthlink.net 1075048736 209.165.23.132 (Sun, 25 Jan 2004 08:38:56 PST) NNTP-Posting-Date: Sun, 25 Jan 2004 08:38:56 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:4795 Date: 2004-01-25T16:38:56+00:00 List-Id: I'm not talking about addresses. Have you never seen a rep clause on a record, for example, that a given compiler will refuse to accept even if it is syntactically legal? I don't happen to have one sitting in my back pocket at the moment, but I *know* I've coded up valid rep clauses on records that compilers have spit out and refused to accept. Technically, it is legal for an implementation to refuse just about any rep clause it doesn't want to be bothered with - so perhaps you've got it coded up one way for one compiler and another way for another compiler. Perhaps there's some arcane trick that can be pulled to change rep clauses on a record on the fly, but I've not seen it (and it sure starts sounding *far* more complex than decrypting a simple conditional compilation directive - maybe this is what frustrates me about the opposition to a conditional compile: Everyone holds out some cumbersome, complex, arcane trickery that is orders of magnitude more difficult to understand and utilize properly as an answer in order to avoid something that is capable of being pretty simple & basic.). What I *have* seen is rep clauses that a compiler refuses to accept - and hence I can't even *get* to runtime because I've got compile errors. Legal or not - Moral or not - I still have to get a job done and a conditonal compilation directive of some sort would fix the problem. MDC Robert I. Eachus wrote: > > You are familar with RM 13.1(22) right? "An implementation need not > support representation items containing nonstatic expressions, except > that an implementation should support a representation item for a given > entity if each nonstatic expression in the representation item is a name > that statically denotes a constant declared before the entity." > > I know it is Implemenation Advice, but especially for Address > representation specifications it is almost required of any decent > compiler that they support at least this. If you don't understand how > to read it look at the "Rosen trick": > > function Random(Gen: Generator) return Float is > Local: Generator; > for Local'Address use Gen'Address; > begin > .... > end Random; > > The value of Gen'Address is definitely non-static. But it is easy for a > compiler to "get it right" in this case because the value of > Local'Address each time the declaration of Local is elaborated. > > What has this got to do with Marin's complaint? He thinks that invalid > representation clauses must be illegal. If they are non-static they > can't be illegal because the value to be set at run-time is wrong. > Either the compiler will raise Program_Error at run-time or execution of > the invalid representation clause will make the program erroneous. See > for example RM 13.3(13): "If an Address is specified, it is the > programmer's responsibility to ensure that the address is valid; > otherwise, program execution is erroneous." > > Since the address in the representation clause need not be static, your > program can set it at run-time depending on the hardware involved. You > mean you have never done that? I have code with address clauses that > depend on system calls made at run-time. > > So loosen up a little Marin, and try writing non-static representation > clauses. Remember 13.1(22) that I referenced above, and that 'Size for > objects (but not subtypes) must be static, RM 13.3(41). But you should > be able to do a lot more with Rep clauses than you have done so far. ;-) > -- ====================================================================== Marin David Condic I work for: http://www.belcan.com/ My project is: http://www.jsf.mil/NSFrames.htm Send Replies To: m o d c @ a m o g c n i c . r "Face it ladies, its not the dress that makes you look fat. Its the FAT that makes you look fat." -- Al Bundy ======================================================================