Re: [Pharo-dev] method Quest :)

2014-03-15 Thread Pharo4Stef
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

Re: [Pharo-dev] method Quest :)

2014-03-15 Thread Pharo4Stef
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:

Re: [Pharo-dev] method Quest :)

2014-03-14 Thread Pharo4Stef
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)

Re: [Pharo-dev] method Quest :)

2014-03-14 Thread Sven Van Caekenberghe
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

[Pharo-dev] method Quest :)

2014-03-13 Thread Pharo4Stef
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)}.

Re: [Pharo-dev] method Quest :)

2014-03-13 Thread Max Leske
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:

Re: [Pharo-dev] method Quest :)

2014-03-13 Thread Damien Cassou
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

Re: [Pharo-dev] method Quest :)

2014-03-13 Thread Pharo4Stef
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) --