[Q]: collection bitAnd ?

Ned Konz ned at bike-nomad.com
Thu Apr 4 16:22:12 UTC 2002


On Wednesday 03 April 2002 11:51 pm, Richard A. O'Keefe wrote:
> How do I do something equal to a bitAnd for a collection?
>
> 	{ 1. 2. 6.} bitAnd:[{ 3. 1. 7.}] --> #(3. 2. 7.)
>
> {1. 2. 6} with: {3. 1. 7} collect: [:x :y| x bitAnd: y]
>
> The result is actually #(1 0 6), if we do
>
> {1. 2. 6} with: {3. 1. 7} collect: [:x :y| x bitOr: y]
>
> the result is #(3 3 7).  I don't know how #(3 2 7) (note the absence
> of dots) is to be derived.

I don't understand how bitAnd: would yield #(3 2 7) given those two sets.

I could see #max: doing it. How do you figure that 3 2 7 would result?

2 bitAnd: 1 => 0
2 bitOr: 1 => 3

as you have described.

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com




More information about the Squeak-dev mailing list