I have to think if the asSet is needed too.
In fact I want in addition
intersectionAndDifferences: aColl
because I want to be able to define nicely
merge: aDict onKeyConflictDoValues: aBlock
as follow
| d d2 |
d := #(1 3 4 5 ) groupedBy: #even.
d2 := #(10 31 41 50
Now I can merge dictionaries in a nice way
testMergeWithNonOverlappingKeys
self run: #testMerge
| d d2 d3 |
d := Dictionary new at: #x put: #(x y z) ; at: #y put: #(e f g ) ; at:
#a put: #(a b c); yourself.
d2 := Dictionary new at: #x put: #(x y z) ; at:
something like that
diffs: aCollection
Answer the set theoretic differences of two collections. The first
element of the result is the difference from the perspective of the receiver
and the second element the difference from the perspective of the argument.
#(a b c d e f)
Are the final #asArray conversions always needed ?
If not, it would be more efficient not to do them every time, no ?
On 14 Mar 2014, at 22:19, Pharo4Stef pharo4s...@free.fr wrote:
something like that
diffs: aCollection
Answer the set theoretic differences of two collections. The
Hi guys
I need the following behavior and I started to implement it (but I’m not sure
that I implemented in a good way).
But may be this method already exist.
testDiffs
self run: #testDiffs
self assert: (#(a b c d e f) diff: #(a b z k)) equals: {#(c d e f) .
#(z k)}.
On 13.03.2014, at 08:52, Pharo4Stef pharo4s...@free.fr wrote:
Hi guys
I need the following behavior and I started to implement it (but I’m not sure
that I implemented in a good way).
But may be this method already exist.
testDiffs
self run: #testDiffs
self assert:
On Thu, Mar 13, 2014 at 8:52 AM, Pharo4Stef pharo4s...@free.fr wrote:
#(a b c d e f) diff: #(a b z k)
Use #difference:
#(a b c d e f) difference: #(a b z k). == #(#f #d #e #c)
#(a b z k) difference: #(a b c d e f) == #(#k #z)
--
Damien Cassou
http://damiencassou.seasidehosting.st
Success
I was thinking that I could do it in one pass.
On Thu, Mar 13, 2014 at 8:52 AM, Pharo4Stef pharo4s...@free.fr wrote:
#(a b c d e f) diff: #(a b z k)
Use #difference:
#(a b c d e f) difference: #(a b z k). == #(#f #d #e #c)
#(a b z k) difference: #(a b c d e f) == #(#k #z)
--