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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,acba876b1e3c9639 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.hanau.net!noris.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: GNAT Optimization of Constant Expressions Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1179355028.624745.258370@q75g2000hsh.googlegroups.com> <464cb4cd$1_3@news.bluewin.ch> <1179442153.169828.109970@l77g2000hsb.googlegroups.com> Date: Fri, 18 May 2007 09:58:33 +0200 Message-ID: NNTP-Posting-Date: 18 May 2007 09:58:07 CEST NNTP-Posting-Host: 03a65123.newsspool4.arcor-online.net X-Trace: DXC=bX6NI`9Gkjc>jlK2>IgHGd4IUK_6=k7>>=I`DNcfSJ;bb[eIRnRBaCd On Thu, 17 May 2007 18:38:34 -0500, Randy Brukardt wrote: [...] > And the use of constants as arguments to those expensive > routines is pretty silly. (Besides, good Ada practice would be to name your > constants, and when you did that, you got essentially the same code as with > Fortran.) I think that it not a good idea to rely on good practice. There is a language problem of specifying that the calls to a function with static constant shall yield static result. This is not just sin (Pi/3.0), but also for ... loop if Match (Text, ) then or Create_Combo_Box ("ada" + "c" + "c++" + ...); or 5.0 * m + 10.0 * feet Folding self-descriptive expressions into constants declared miles away from their only use is not a good style. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de