On 13 Dec 2002 at 12:33, CBFalconer wrote:
[...]
Indeed. But "Boolean (32)" doesn't create 32 1-bit Booleans but rather a single 32-bit variable with roughly Boolean semantics ("roughly" meaning that 0 is FALSE and all other values are TRUE). There is no way to achieve that directly using "packed" and the standard Boolean type.
And there is no need for such an entity. A logical expression such as "X = 0" or "X <> 0" covers it quite nicely. It also avoids the eternal C confusion about what IS a logical expression.
So why does Pascal have the Boolean type if we can just discard it in favour of a numerical comparison?
If we are to retain a Boolean type (I don't know whether the standard requires it or not) then it makes sense to be able to have a 32-bit Boolean, depending on one's needs.
I for one would prefer not to have to change all occurrences of "foo (bar1, bool1, bool2, bool3)" to "foo (bar1, bar2 = 0, bar3 <> 0, bar4 = 0)"
And, assuming one of these booleans is a VAR parameter? I don't think that the resulting contortions would lead to more readable code.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~african_chief/