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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,9a0ff0bffdf63657 X-Google-Attributes: gidfac41,public X-Google-Thread: f43e6,9a0ff0bffdf63657 X-Google-Attributes: gidf43e6,public X-Google-Thread: 1108a1,9a0ff0bffdf63657 X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,4b06f8f15f01a568 X-Google-Attributes: gid103376,public From: Martin@nezumi.demon.co.uk (Martin Tom Brown) Subject: Re: Optimizing recursion (was Re: Why C++ is successful) Date: 1998/08/26 Message-ID: <904115138snz@nezumi.demon.co.uk>#1/1 X-Deja-AN: 384857448 References: <6qfhri$gs7$1@nnrp1.dejanews.com> <35E32841.49A5343D@fv.com> X-Complaints-To: abuse@demon.net X-Mail2News-Path: news.demon.net!nezumi.demon.co.uk X-Trace: mail2news.demon.co.uk 904122530 mail2news:17960 mail2news mail2news.demon.co.uk Organization: Nezumi Reply-To: Martin@nezumi.demon.co.uk Newsgroups: comp.lang.eiffel,comp.object,comp.software-eng,comp.lang.ada Date: 1998-08-26T00:00:00+00:00 List-Id: On Tuesday, in article <35E32841.49A5343D@fv.com> dnew@fv.com "Darren New" wrote: > > To the greatest extent possible, the goal in Ada is to make the > > code understandable to the reader. Pragma Inline is one tool for > > creating an abstraction without having to pay for it at run-time. > > Why wouldn't the compiler just generate the best code that is > sematically equivalent to the Ada source? Why does the author of the > code have to tell the compiler that the *author* thinks it's more > efficient to expand the routine inline than to call it as a function? Historically some compilers (not just Ada) have required less than subtle hints from the programmer to generate efficient code. I prefer inlining rules based on length of extra code generated by the inlining - but even then you can get absurdities. "Best" means different things to different people fastest vs shortest being the two parameters most commonly being traded by inlining. Regards, -- Martin Brown __ CIS: 71651,470 Scientific Software Consultancy /^,,)__/