Re: Absense of bool
- From: David Thompson <dave.thompson2@xxxxxxxxxxx>
- Date: Sun, 25 Nov 2007 23:40:26 GMT
On Sun, 04 Nov 2007 09:53:31 +0000, Philip Potter
<pgp@xxxxxxxxxxxxxxx> wrote:
<snip>
Do you have an example of a language with a boolean type which willPascal can use only 1 bit for a BOOLEAN and only the needed bits for a
store the boolean in a location smaller than a byte?
(small) subrange or enum within an array or record, especially if you
declare it PACKED. At least in classic Pascal there is no way to take
the address of these so it doesn't matter that they aren't on a byte
(or word) boundary.
PL/I can do both of those for BIT(1), but AFAIK there's no syntax to
specify packing, so IMLE it is usually the default. (You can
explicitly declare padding, but it's hard to get it portably correct.)
PL/I also has BIT strings (fixed or variable-length=counted) which are
inherently packed, and whose elements cannot be pointed to (but can be
selected by SUBSTR).
Ada rather like Pascal has BOOLEAN and subrange/enum types, a general
option (pragma) for packing, and also more verbose options for exact
representation which allow you to really force desired packing.
- formerly david.thompson1 || achar(64) || worldnet.att.net
.
- References:
- Absense of bool
- From: AommiK
- Re: Absense of bool
- From: Philip Potter
- Absense of bool
- Prev by Date: Re: Keith Thompson's messages dont come through
- Next by Date: Re: error in sending post to log in google account
- Previous by thread: Re: Absense of bool
- Next by thread: Re: Absense of bool
- Index(es):
Relevant Pages
|