comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@world.std.com>
Subject: Re: Right of Optimize Eager Evaluation Away
Date: 1999/11/28
Date: 1999-11-28T00:00:00+00:00	[thread overview]
Message-ID: <wccr9haibu3.fsf@world.std.com> (raw)
In-Reply-To: 863dtqfo26.fsf@ppp-173-146.villette.club-internet.fr

Laurent Guerby <guerby@acm.org> 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




  reply	other threads:[~1999-11-28  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-28  0:00 Right of Optimize Eager Evaluation Away Laurent Guerby
1999-11-28  0:00 ` Robert A Duff [this message]
1999-11-28  0:00   ` Laurent Guerby
1999-11-29  0:00     ` Nick Roberts
1999-11-29  0:00       ` Robert A Duff
1999-11-29  0:00         ` Laurent Guerby
1999-11-29  0:00           ` Niklas Holsti
1999-11-29  0:00           ` Robert A Duff
1999-11-30  0:00             ` Laurent Guerby
1999-11-29  0:00           ` Lutz Donnerhacke
1999-11-29  0:00 ` Jean-Pierre Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox