comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Is this an error in compiler
Date: Sun, 11 Sep 2022 19:18:24 +0200	[thread overview]
Message-ID: <tfl58u$17u2$1@gioia.aioe.org> (raw)
In-Reply-To: a1d0cc99-bdf2-4415-9b01-fbddb9818751n@googlegroups.com

On 2022-09-11 18:47, reinert wrote:
> Could the result of
> 
> if function1 and function2 then ....
> 
> depend on the order of evaluation ( in some rare situations when f.eks. function2 affects the outcome from function1)?

The order is only one half of the problem. Another one is eager 
evaluation. Both function1 and function2 are guaranteed to be evaluated 
in absence of exceptions.

Short-circuit operators are meant to enforce both the order of 
evaluation and laziness of the second term:

   if function1 and then function2 then ....

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2022-09-11 17:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-11  7:19 Is this an error in compiler reinert
2022-09-11  8:10 ` Simon Wright
2022-09-11 10:52   ` reinert
2022-09-11 12:30   ` Jeffrey R.Carter
2022-09-11 12:59     ` Dmitry A. Kazakov
2022-09-11 14:44     ` Niklas Holsti
2022-09-11 15:47       ` Jeffrey R.Carter
2022-09-11 16:47         ` reinert
2022-09-11 17:18           ` Dmitry A. Kazakov [this message]
2022-09-12  7:05       ` Simon Wright
2022-09-11 15:14   ` Oliver Kellogg
replies disabled

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