Open hostilefork opened 5 years ago
This is discussed and commented on in this blog entry: http://www.rebol.net/r3blogs/0114.html
"Furthermore, we will need to consider the various results of logical operations performed on bitsets, including AND, OR, XOR, but also UNION, INTERSECT, DIFFERENCE, and EXCLUDE. These become just a bit more complicated internally to get the desired results. No pun intended."
However, it was not taken into account--as the operations run the same code as for BINARY!.
The NEGATE operation on bitsets does not actually invert the bits, but sets a flag on the bitset indicating that search answers should be negated:
But if you try to exclude 1 from the negated bitset, you get an answer that acts as if you hadn't been asking it on a negated bitset:
The code doesn't honor the negation bit, so all it did was clear it on the result...and clear out 1 (that wasn't there in the data being negated), leaving the 2.
Red has a similar problem, but thinks the bitset is #{60) as a result of the exclusion.