On 12 Dec 2002 at 16:43, Prof. A Olowofoyeku (The African Chief) wrote:
Does the construct "packed -(2 pow (n - 1)) .. 2 pow (n - 1) - 1" guarantee the size (in bits)?
That was the essence of my question to Frank. The examples given in the GPC manual under "packed" seem to imply that it does, e.g., packing a subrange of 0..31 is equivalent to "Cardinal (5)".
If it does, how is that construction better than "Integer (n)"?
"Integer (n)" is being allowed only due to a scoping bug in GPC. If that bug is fixed, then "Integer (n)" becomes illegal. That's why alternate ways of expressing "Integer (n)" are being discussed.
And when, one day, someone needs "Boolean (64)", "Boolean (128)", or "Boolean (24)", etc., then?
"Boolean (8)" is only a convenience; using "packed 0..255" (i.e., eight-bit cardinal) and a "To_Boolean" function would be equivalent.
Have you ever needed a "Boolean (13)", e.g.? ;-)
-- Dave