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

[REBOL] Re: [Mutability bitset] Puzzle (*very hard*!)

From: lmecir:mbox:vol:cz at: 29-Sep-2006 16:26

Gregg Irwin napsal(a):
> Hi Ladislav, > > LM> are REBOL bitsets mutable or not? > > Two bitsets can refer to the same set of bits, and will return true > for SAME?, but they aren't references to the same underlying bitset. >
they may or may not, that is the next part of the puzzle.
> However, you can use INSERT and REMOVE to modify a bitset, so they're > mutable in that sense. >
checking, whether INSERT mutates bitsets: bitset1: charset "" bitset1-2: :bitset1 insert bitset1-2 #"a" ; == make bitset! #{ 0000000000000000000000000200000000000000000000000000000000000000 } bitset1 ; == make bitset! #{ 0000000000000000000000000200000000000000000000000000000000000000 } , i.e. the bitset was indeed mutated, not just replaced! Congratulations, your answer was correct. So now the connected question: *Is there a way how to discern equal bitsets that don't reference identical underlying bitset?*