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-Thread: 103376,8de7eedad50552f1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Ada bench : word frequency Date: 11 Apr 2005 19:56:15 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1111613194.164413.310450@l41g2000cwc.googlegroups.com> <42432EC3.37DC5279@fakeaddress.nil> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1113263776 14254 192.74.137.71 (11 Apr 2005 23:56:16 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 11 Apr 2005 23:56:16 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:10382 Date: 2005-04-11T19:56:15-04:00 List-Id: Marius Amado Alves writes: > Done. (I have only not inlined the recursive functions, fearing a > compilation result of infinite size...) There's nothing wrong with putting pragma Inline on a recursive procedure. The compiler can inline some number of levels, or not inline at all, but it won't generate an infinite-sized amount of machine code, nor take an infinite amount of time to generate that code. I've seen a compiler where: Put(Factorial(7)); was optimized to: Put(5040); where Factorial is the usual recursive definition of the factorial function. It inlined 7 levels, and then did some constant propagation, thus figuring out the answer at compile time. - Bob