Sujet : Re: Shortcut Booleans
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.cDate : 10. Jun 2024, 02:51:30
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v45m72$2pe8$1@dont-email.me>
References : 1 2 3 4
User-Agent : Pan/0.158 (Avdiivka; )
On Sun, 9 Jun 2024 13:35:12 +0200, David Brown wrote:
In general, it would be inconvenient if you did not know whether "a @ b"
was going to evaluate "b", including all function calls and
side-effects.
Ada has “and then” and “or else”, so that you can specifically request
shortcut evaluation when program correctness depends on it, and leave it
up to the implementation otherwise.
This principle could be extended to other situations ...