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,571930b4ff0bc1ee X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-27 23:44:33 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!falcon.america.net!sunqbc.risq.qc.ca!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!skynet.be!news.algonet.se!algonet!pepsi.tninet.se!not-for-mail From: Mats Karlssohn Newsgroups: comp.lang.ada Subject: Re: Compile time executed functions Date: Wed, 28 Mar 2001 09:08:01 +0200 Organization: MIDA Systemutveckling AB Message-ID: <3AC18DD1.EF25CE42@mida.se> References: <3AC03CCE.70E3C2D5@mida.se> NNTP-Posting-Host: sdu184-72.ppp.algonet.se Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: zingo.tninet.se 985765043 17383 195.163.72.184 (28 Mar 2001 07:37:23 GMT) X-Complaints-To: abuse@algo.net NNTP-Posting-Date: 28 Mar 2001 07:37:23 GMT X-Mailer: Mozilla 4.6 [en] (WinNT; I) X-Accept-Language: en Xref: supernews.google.com comp.lang.ada:6152 Date: 2001-03-28T07:37:23+00:00 List-Id: Ken Garlington wrote: > > I think the key statement is "The constant is really a constant and should > therefore be placed in ROM." Well actually, I intended that to be one of the keystatements. The simple cases (like "Foo : constant Integer := 4;") seems to work for me already (using GNAT and adapted linker script). > AFAIK, you can create an _Ada_ constant from a function. Whether it's placed > in ROM is a concept outside the scope of the language, and is a function of > compiler optimizations. Agreed, the placement of the constant is not a Ada language issue. > A more general solution, as you noted, is to write an Ada program that > writes an easier-to-optimize Ada program (or, in some cases, assembly > instructions). We have several of those for commonly-used capabilities in > our domain. And I currently does not feel that good about that solution. Most of the practical issuses,like different project members using old, or even worse own versions of the table generator (wich is not included in configuration management) can (add WILL) be solved by some more project regulations. The other issue is that I feel that within Ada's expressive powers it would be useful to have _some_ of the possibilities that is availible when using C++ templates and/or C preprocessor macros. (Please, no flames on the two 'bad words' above!) -- Mats Karlssohn, developer mailto:mats@mida.se Mida Systemutveckling AB http://www.mida.se Box 64, S-732 22 ARBOGA, SWEDEN Phone: +46-(0)589-89808 Fax: +46-(0)589-89809