[Q]: collection bitAnd ?

Karl Ramberg karl.ramberg at chello.se
Tue Apr 9 07:56:50 UTC 2002


Ned Konz wrote:
> 
> 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.

Sorry to confuse you, I was looking for a #max function but
wrongly called it bitAnd:

Karl



More information about the Squeak-dev mailing list