[REBOL] Re: Temporal data [was is REBOL OO]
From: SunandaDH:aol at: 14-Jan-2004 17:15
Hi Gregg!
> Sac> 256 bits isn't enough for a bit-per-day for a whole year. We need
> Sac> two bitmaps.
>
> You can do it with one.
Amazing, thanks. I think I'd got myself blindsided about the maximum length
of a bitset because of the length of a charset charset. I should have
remembered that Carl is subtler than most of my assumptions.
Incidentally, I thought I was about to find a bug in your code, or in the way
bits are inserted in bitsets. Consider this:
mybitset: make bitset 128
insert mybitset 7
insert mybitset 8
mold mybitset
"make bitset! #{80010000000000000000000000000000}"
Look at that: those two bits are nowhere near adjacent. But:
available? mybitset 2
== 8
Correct answer!
Must be an endian issue in the way bitsets are displayed. Bits in an octet
are numbered left to right (from 0 to 7, natch) but displayed right to left,
thus creating an optical illusion that bits 0 and 15 are adjacent:
>> mybitset: make bitset 16
== make bitset! #{0000}
>> insert mybitset 0
== make bitset! #{0100}
>> insert mybitset 15
== make bitset! #{0180}
Just another of those REBOL gotchas.
Sunanda.