gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Boolean constants


From: Fischlin Andreas
Subject: Re: Boolean constants
Date: Sun, 25 Aug 2024 13:01:30 +0000

Dear Michael,

All are legal Modula-2 constant definitions. It is not clear to me why you write “at least the line "Logical2 = NOT Logical1;" and "Logical3 = NOT TRUE;" should be OK.” And as there is nothing to be executed at run time, by crash you mean the compiler crashes without an error message?

Cheers,
Andreas


ETH Zurich
Prof. em. Dr. Andreas Fischlin
Formerly IPCC Vice-Chair WGII
Systems Ecology - Institute of Biogeochemistry and Pollutant Dynamics
CHN E 24
Universitaetstrasse 16
8092 Zurich
SWITZERLAND


+41 44 633-6090 phone
+41 79 595-4050 mobile

             Make it as simple as possible, but distrust it!
________________________________________________________________________















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



Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]