bar - Bit array module
Module Description
The bar module implements a bit array.
Module Words
Bit array structure
bar%
( - n )
Get the required space for the bar data structure
Bit array creation, initialisation and destruction
bar-init
( n:length w:bar - )
Initialise the bit array
bar-create
( C: n:length "name" - R: - w:bar )
Create a bit array in the dictionary
bar-new
( n:length - w:bar )
Create a bit array on the heap
bar-free
( w:bar - )
Free the bit array from the heap
Member words
bar-length@
( w:bar - u )
Get the number of bits in the bit array
bar-index?
( n w:bar - f )
Check if an index is valid in the bit array
Bit set words
bar-set-bit
( n w:bar - )
Set the indexth bit
bar-set-bits
( u:number n:start w:bar - )
Set a range of bits
bar-set
( w:bar - )
Set all bits in the bit array
Bit reset words
bar-reset-bit
( n w:bar - )
Reset the indexth bit
bar-reset-bits
( u:number n:start w:bar - )
Reset a range of bits
bar-reset
( w:bar - )
Reset all bits in the bit array
Bit invert words
bar-invert-bit
( n w:bar - )
Invert the indexth bit
bar-invert-bits
( u:number n:start w:bar - )
Invert a range of bits
bar-invert
( w:bar - )
Invert all bits in the bit array
Bit check words
bar-get-bit
( n w:bar - f )
Check if the indexth bit is set
bar-count-bits
( n:number n:start w:bar - u )
Count the number of bits set in a range
bar-count
( w:bar - u )
Count the number of bits set in the bit array
bar-execute
( ... xt w:bar - ... )
Execute xt for every bit in the bit array
Inspection
bar-dump
( w:bar - )
Dump the bit array
generated 09-Jan-2007 by
ofcfrth-0.2.0