How do I do something equal to a bitAnd for a collection?
{ 1. 2. 6.} bitAnd:[{ 3. 1. 7.}] --> #(3. 2. 7.)
On Sunday 31 March 2002 02:14 pm, Karl Ramberg 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: [ :a :b | a bitAnd: b ] => #(1 0 6)
I don't know about your math. Do you mean to bitAnd: each corresponding element?
Ned Konz wrote:
On Sunday 31 March 2002 02:14 pm, Karl Ramberg 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: [ :a :b | a bitAnd: b ] => #(1 0 6)
I don't know about your math. Do you mean to bitAnd: each corresponding element?
I don't now about math :-) But your suggestion put me on the right track :
{ 1. 2. 6.} with: { 3. 1. 7.} collect: [ :a :b | a max: b ] => #(3 2 7)
Thanks, Karl
squeak-dev@lists.squeakfoundation.org