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,FREEMAIL_FROM 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-22 18:48:53 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!c03.atl99!sjc70.webusenet.com!news.webusenet.com!pd7cy2so!shaw.ca!border1.nntp.ash.giganews.com!border2.nntp.sjc.giganews.com!border1.nntp.sjc.giganews.com!nntp.giganews.com!local1.nntp.sjc.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 22 Jan 2004 20:47:07 -0600 Date: Thu, 22 Jan 2004 21:47:06 -0500 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Standard Ada Preprocessor (Was: why ada is so unpopular ?) References: <49cbf610.0401170627.79c3dfe5@posting.google.com> <400A9B48.3060100@noplace.com> <400BD4B5.6000307@noplace.com> <400BDB7C.40100@noplace.com> <400D2150.6000705@noplace.com> <400E72F9.8060501@noplace.com> <100upo7ln5e3k59@corp.supernews.com> <400FC8E8.2040100@noplace.com> In-Reply-To: <400FC8E8.2040100@noplace.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <_JSdna166JuxFo3dRVn-hg@comcast.com> NNTP-Posting-Host: 24.147.77.160 X-Trace: sv3-ppLKgo03plpA4f5cCCN9AErAPEr39bxAUjIKhx+pgHQz7LfnWdc4139CFQOlKWczM0gyELFGD5KM2hD!OSB2jiURPVaAxrySTN4VIF1VT9LdtdPdEfHzOpuxva/qqfAQ7FR7W20I59HttA== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:4689 Date: 2004-01-22T21:47:06-05:00 List-Id: Marin David Condic wrote: > How about *adding* something to system like: > > System.Compiler_ID : constant String := "Something Useful Here" ; > > This would not break anything that was already using System_Name > (although given its general uselessness, I doubt that is very much) and > would provide a mechanism for identifying the compiler that is doing the > job. Then statements like "if (Compiler_ID = "Something") then..." would > possibly be useful. In Ada 83 that wouldn't have worked. But I think it would be wonderful to get rid of the type Name in system and add three string constants: Operating_System: constant String := implementation_dependent; Hardware_Architecture: constant String := implementation_dependent; Compiler: constant String := implementation_dependent; Version: constant String := implementation_dependent; If I were going to write this up as an AI, I would include as "Implementation Advice" that the strings be static, that configuration pragmas be allowed to affect the values, and that the version strings for a particular compiler should sort as strings into cronological order. Oh, and redefine System_Name to return a String, but not necessarily a static String. It should give the name of the machine the program is running on. (The machine I am typing this on is Milliways.) Memory_Size should be redefined as a function that returns the system memory size, and there should be a functions Stack_Size and Heap_Size that return the actual maximum permitted Stack_Size (either for the main program or for the task where it is called), any the size of the default heap. (The more I think about it, the type they return is not a stumbling block. That should be an implementation defined integer or modular type. Any program that needs to use the type will either use numberic literals or do a type conversion.) Anyone interested enough to propose this as a (late) addition to Ada0Y? Since Jean Ichbiah interchanged Name and System_Name at the very last moment in Ada 83, there certainly is a precedent for changing System late in the game. As far as I know that was the only significant change between the printers proof and the published ANSI standard. (Page number 2-2 certainly wasn't significant. ;-) > You still need some mechanism to wrap that around declarations and other > stuff. Perhaps that could be solved with some flavor of a pragma that > could take a case-like if statement around what you want conditionally > compiled. Maybe the whole thing should be solved with a pragma since you > don't want to have to first "with" System before you can start > conditionally withing other packages. That also gets simpler to deal > with from a language perspective since there has always been the ability > to have implementation defined pragmas. My current approach to this problem is to have packages OS, and ISA. Then in whatever library I am working these do the necesssary via package renames. I've thought about using a preprocessor, but so far the renames work and look much neater, as far as the source code is concerned. What I would really, really like is for the compiler to expand those names based on compile time flags and defaults. I don't think that trick should be a language defined/required behavior, but I don't see any reason why a compiler couldn't validate even if it included such a feature. -- Robert I. Eachus "The war on terror is a different kind of war, waged capture by capture, cell by cell, and victory by victory. Our security is assured by our perseverance and by our sure belief in the success of liberty." -- George W. Bush