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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f0ba82308a594485 X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: Right of Optimize Eager Evaluation Away Date: 1999/11/28 Message-ID: #1/1 X-Deja-AN: 554164712 Sender: bobduff@world.std.com (Robert A Duff) References: <863dtqfo26.fsf@ppp-173-146.villette.club-internet.fr> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1999-11-28T00:00:00+00:00 List-Id: Laurent Guerby writes: > The question is: is a smart Ada 95 compiler allowed to generate code > that looks like this: > > if C then > X := Super_Expensive_Function_Call_1; > else > X := Super_Expensive_Function_Call_2; > end if; > > that is to say, be lazy about its argument, and so might > save execution time. No. The function arguments may be evaluated in either order, so in case of exception, the other one might not happen. But without exceptions, both arguments will be evaluated. - Bob