Bart van den Broek wrote:
If I (as an inactive observer) may comment / make a suggestion; when a constant of ByteBoole, WordBoole or LongBoole is evaluated, presumably at compile time, convert it to a value of type Boolean. As a consequence: type VeryTrue = ByteBool (10) .. ByteBool (42); means type VeryTrue = True..True; Also, in the test program fjf1102, (Ord (a) = 1) and (Ord (b) = 1) and (Ord (c) = 1) holds, and more specifically Ord( ByteBool(42) ) = 1.
Interesting idea, but if done only for constants (as I understand your suggestion), it would also lead to strange effects:
program foo;
var n: Integer = 42;
begin WriteLn (ByteBool (n) = ByteBool (42)) { => False } end.
Besides, it probably wouldn't be 100% Delphi compatible, as Delphi documentation (as quoted by Adriaan) states that Ord of "True" of such types can be any value <> 0.
Motivation: the top definition of VeryTrue deals with the internal representation of Booleans. If the programmer *wants* to deal with this, it is IMHO more clear to use the values 10 and 42 and cast later.
BTW, I didn't mean to advocate the use of types such as my VeryTrue for any purpose, just point out that such declarations are possible ...
Similarly, when a specific value other than 0 or 1 for, say a ByteBool parameter must be passed to an external library function, it is IMHO more clear to use Byte instead.
Ack.
Frank