Bit type?

BCS ao at pathlink.com
Sat Nov 24 10:44:49 PST 2007


Reply to Stewart,

> "Dan" <murpsoft at hotmail.com> wrote in message
> news:fi7r8q$l05$1 at digitalmars.com...
> 
>> I thought I recalled D having a "bit[]" type with the restriction
>> that you could only use bit[n*8]?
>> 
> There was once a bit type, but it never had such a restriction.
> Walter removed it, I think because it was found too complicated and
> bug-prone to implement.  Or something like that.
> 

I think it was dropped because there was no way to get uniform slice semantics

bit[100] bits;

auto bits[20..25]; 

For that to even be doable it needs a copy that junks reference semantics, 
or needs to  play games with pointers in ways that restrict sliced bit arrays 
to only 1/8th of the address space (low 3 bits of pointer are used for position 
in byte and byte location is got by bit shifting, but now the high order 
bits need to be implicit :P ) 





More information about the Digitalmars-d mailing list