But since this is about Pascal, and probably specifically fpc style, applying other conventions seems a bit out of scope?
It's about what is logically and mathematically correct.
Speaking about a numerical value for "true", are you sure that in maths (i.e. boolean algebra) there is a numerical value to the logical states?
I could have sworn that is a by product of information technology.... (And this topic started about numerical values...).
FPC's documentation states that when it comes to the boolean type only the value 1 is considered TRUE but, that is not true. FPC considers values other than 1 to be TRUE
Does it, or does it consider them undefined?
Because the result can by chance be identical. An undefined value is allowed to behave like "true", that does not break the contract.
I know, you refer to the machine code, that does not explicitly perform the check for "1". But it performs a check that will always based on the following ordinary values of a bool behave for
- 0 as false
- 1 as true
- other as either (where "either" can is some case be a fixed choice, but is not guaranteed to be fixed)
Also:
I am neither going to reread the linked thread for any word picking in it, nor analyse the documentation for any potential English wording that could be twisted to more than one meaning.
It may be or not be that the documentation could be improved.
But, I can (I have the ability, and the good will) read it as (with regards to boolean / ignore bytebool)
0 is the ordinary value of false
1 is the ord val of true
any other ord value is not defined, and considered undefined.
And example asm code like testing "tst rax" or "or rax, rax" followed by only on of "be" or "bz" => is totally in line with that. It does not break the undefined state.