Peter Gerwinski wrote:
Frank Heckenbach wrote:
When updating the documentation, Peter N Lewis and I came to the problem how to describe the Boolean values `True' and `False'.
Peter suggested "true (conforming to reality) and false (different from reality", but I think "reality" is not a good term here (what do computer programs have to do with reality, anyway ;-).
What about this?
"True" stands for a condition which is always fullfilled - such as "2 = 2" - and "False" stands for a condition which is never fullfilled - such as "1 = 0".
There might be a danger of confusion WRT "always":
if (i >= 0) = True then Foo
Someone might think that `Foo' is only executed only if i is *always* >= 0 (e.g., declared as an unsigned type). It's silly, I know ...
In order to illustrate that other uses are possible at all, an example with a Boolean variable should follow.
Actually, the current example reads:
program TrueDemo;
var a: Boolean; begin a := 1 = 1; { True } WriteLn (Ord (a)); { 1 } WriteLn (a); { True } end.
So perhaps it would be better to add the more common usage in conditionals and loops. ;-)
Or, actually, add `True' in the first place. It might be useful for a demo program to contain the thing that is demonstrated at all (not only in comments). ;-)
Frank