Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] bitset help

From: rotenca::telvia::it at: 26-Sep-2002 16:42

I do not understand how can be used all this new stuff from the new betas. Can someone make an useful example to me? I knows only how to use bitset in parse rule for char, but this seems something different. These are the RT docs: -------------------- 2.3. New Bitset Functions: CLEAR, LENGTH?, EMPTY? Three new functions (actions) have been added to bitsets: The CLEAR function quickly clears all bits to zero. The LENGTH? function returns the number of bits in the bitset (always multiple of 8). The EMPTY? function returns TRUE if any bit is set, otherwise it returns FALSE. (Note that EMPTY? is the same function as TAIL?; therefore, TAIL? also returns the same results, but the word has no meaning for bitsets.) Bitsets are used as high performance logic arrays for character sets and hashes. Examples:
>> items: make bitset! 40
== make bitset! #{0000000000}
>> length? items
== 40 -------------------- --- Ciao Romano