|
From: | address@hidden |
Subject: | AW: Boolean constants |
Date: | Mon, 26 Aug 2024 12:44:41 +0200 (CEST) |
Andreas,
you are right - it crashes the compiler (versions 13 and 14 to answer Gaius question as well).
And I only meant that a form "CONST LogicalX = (1 = 1);" is not the best way to define the value of a boolean constant. It is legal but not good style (at least in my personal view).
Gruß
Michael
-----Original-Nachricht-----
Betreff: Re: Boolean constants
Datum: 2024-08-25T15:01:34+0200
Von: "Fischlin Andreas" <andreas.fischlin@env.ethz.ch>
An: "Michael Riedl" <udo-michael.riedl@t-online.de>
On 25 Aug 2024, at 11:09, Michael Riedl <udo-michael.riedl@t-online.de> wrote:
Hallo Gaius,
can you have a look on the following small piece of code:
MODULE TestBool;
CONST Logical1 = TRUE;
Logical2 = NOT Logical1; (* crash *)
Logical3 = NOT TRUE; (* crash *)
Logical4 = (1 = 0); (* crash *)
Logical5 = (1 = 1); (* crash *)
BEGIN
END TestBool.
I would think that at least the line "Logical2 = NOT Logical1;" and "Logical3 = NOT TRUE;" should be OK.
The lines with Logical4 and Logical5 are for sure "quick and dirty" but handy to quickly switch off and on some code segments during development (would not do that in production code).
Gruß / Greetings
Michael
[Prev in Thread] | Current Thread | [Next in Thread] |