Issue 4780 in pharo: Unify union / difference / intersection on Collections

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
34 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4780 in pharo: Unify union / difference / intersection on Collections

pharo
Updates:
        Status: ReviewNeeded

Comment #20 on issue 4780 by [hidden email]: Unify union /  
difference / intersection on Collections
http://code.google.com/p/pharo/issues/detail?id=4780#c20

This Issue has been marked for review by Ulysse the Monkey:

Monkey went bananas:
--------------------
Error while loading  
SLICE-Issue-4780-Unify-union-difference-intersection-on-Collections-CamilloBruni.3  
from http://ss3.gemstone.com/ss/PharoInbox:
        Warning: This package depends on the following classes:
   SMarkSuite
You must resolve these dependencies before you will be able to load these  
definitions:
   DictonaryBench
  1: MCMultiPackageLoader(Object)>>notify:
  2: MCMultiPackageLoader(MCPackageLoader)>>warnAboutDependencies
  3: MCMultiPackageLoader(MCPackageLoader)>>loadWithNameLike:
  4: MCVersionLoader>>loadWithNameLike:
  5: MCVersionLoader>>load
  6: GoferLoad>>execute
  7: Gofer>>execute:do:
  8: Gofer>>execute:
  9: Gofer>>load
10: GoferResolvedReference>>load
        ...
----------------------------------------------------------
Loaded Source:  
SLICE-Issue-4780-Unify-union-difference-intersection-on-Collections-CamilloBruni.3  
from http://ss3.gemstone.com/ss/PharoInbox
Tested using Pharo-1.4-14172-a on Croquet Closure Stack VM  
[StackInterpreter VMMaker-oscog-EstebanLorenzano.109] 21.0


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4780 in pharo: Unify union / difference / intersection on Collections

pharo
Updates:
        Status: MonkeyIsChecking

Comment #21 on issue 4780 by [hidden email]: Unify union /  
difference / intersection on Collections
http://code.google.com/p/pharo/issues/detail?id=4780#c21

The Monkey is currently checking this issue. Please don't change it!


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4780 in pharo: Unify union / difference / intersection on Collections

pharo
Updates:
        Status: ReviewNeeded

Comment #22 on issue 4780 by [hidden email]: Unify union /  
difference / intersection on Collections
http://code.google.com/p/pharo/issues/detail?id=4780#c22

This Issue has been marked for review by Ulysse the Monkey:

Test Results:
-------------
Failures:
        OrderedCollectionTest>>#testDifferenceWithSeparateCollection
        LiteralDictionaryTest>>#testDifference
        IdentityDictionaryTest>>#testDifferenceWithSeparateCollection
        HeapTest>>#testDifference
        BagTest>>#testDifferenceWithSeparateCollection
        StringTest>>#testDifference
        WeakIdentityKeyDictionaryTest>>#testDifference
        SmallDictionaryTest>>#testIntersectionItself
        LinkedListTest>>#testIntersectionItself
        DictionaryTest>>#testDifferenceWithSeparateCollection
        SmallDictionaryTest>>#testDifference
        WeakKeyToCollectionDictionaryTest>>#testDifference
        SmallIdentityDictionaryTest>>#testIntersectionItself
        SortedCollectionTest>>#testDifferenceWithSeparateCollection
        LiteralDictionaryTest>>#testDifferenceWithSeparateCollection
        HeapTest>>#testIntersectionItself
        StringTest>>#testDifferenceWithSeparateCollection
        StringTest>>#testIntersectionItself
        SmallIdentityDictionaryTest>>#testDifference
        PluggableDictionaryTest>>#testIntersectionItself
        OrderedCollectionTest>>#testIntersectionItself
        WeakKeyDictionaryTest>>#testDifference
        WeakIdentityKeyDictionaryTest>>#testDifferenceWithSeparateCollection
        SortedCollectionTest>>#testIntersectionItself
        PluggableDictionaryTest>>#testDifference
        WeakKeyToCollectionDictionaryTest>>#testDifferenceWithSeparateCollection
        OrderedCollectionTest>>#testDifference
        FloatArrayTest>>#testIntersectionItself
        SymbolTest>>#testDifference
        IdentityDictionaryTest>>#testIntersectionItself
        DictionaryTest>>#testIntersectionItself
        BagTest>>#testDifference
        PluggableDictionaryTest>>#testDifferenceWithSeparateCollection
        SortedCollectionTest>>#testDifference
        SymbolTest>>#testDifferenceWithSeparateCollection
        ArrayTest>>#testIntersectionItself
        DictionaryTest>>#testDifference
        WeakIdentityKeyDictionaryTest>>#testIntersectionItself
        WeakValueDictionaryTest>>#testDifference
        WeakValueDictionaryTest>>#testIntersectionItself
        LiteralDictionaryTest>>#testIntersectionItself
        ArrayTest>>#testDifference
        WeakKeyToCollectionDictionaryTest>>#testIntersectionItself
        FloatArrayTest>>#testDifferenceWithSeparateCollection
        WeakKeyDictionaryTest>>#testIntersectionItself
        LinkedListTest>>#testDifference
        WeakValueDictionaryTest>>#testDifferenceWithSeparateCollection
        BagTest>>#testIntersectionItself
        SymbolTest>>#testIntersectionItself
        HeapTest>>#testDifferenceWithSeparateCollection
        SmallDictionaryTest>>#testDifferenceWithSeparateCollection
        LinkedListTest>>#testDifferenceWithSeparateCollection
        ArrayTest>>#testDifferenceWithSeparateCollection
        SmallIdentityDictionaryTest>>#testDifferenceWithSeparateCollection
        IdentityDictionaryTest>>#testDifference
        WeakKeyDictionaryTest>>#testDifferenceWithSeparateCollection
        FloatArrayTest>>#testDifference

----------------------------------------------------------
Loaded Source:  
SLICE-Issue-4780-Unify-union-difference-intersection-on-Collections-CamilloBruni.4  
from http://ss3.gemstone.com/ss/PharoInbox
Tested using Pharo-1.4-14172-a on Croquet Closure Stack VM  
[StackInterpreter VMMaker-oscog-EstebanLorenzano.109] 21.0


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4780 in pharo: Unify union / difference / intersection on Collections

pharo
Updates:
        Status: MonkeyIsChecking

Comment #23 on issue 4780 by [hidden email]: Unify union /  
difference / intersection on Collections
http://code.google.com/p/pharo/issues/detail?id=4780#c23

The Monkey is currently checking this issue. Please don't change it!


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4780 in pharo: Unify union / difference / intersection on Collections

pharo
Updates:
        Status: FixToInclude

Comment #24 on issue 4780 by [hidden email]: Unify union /  
difference / intersection on Collections
http://code.google.com/p/pharo/issues/detail?id=4780#c24

This Issue has been checked by Ulysse the Monkey
       
11058 tests passed in 00:01:24s:
================================
        CollectionsTests-Arrayed (1120)
        CollectionsTests-Atomic (24)
        CollectionsTests-Sequenceable (1812)
        CollectionsTests-SplitJoin (54)
        CollectionsTests-Stack (32)
        CollectionsTests-Streams (74)
        CollectionsTests-Strings (1174)
        CollectionsTests-Support (24)
        CollectionsTests-Text (80)
        CollectionsTests-Unordered (3912)
        CollectionsTests-Weak (1486)
        CompilerTests (30)
        KernelTests-Chronology (574)
        KernelTests-Classes (59)
        KernelTests-Exception (2)
        KernelTests-Methods (176)
        KernelTests-Numbers (232)
        KernelTests-Objects (85)
        KernelTests-Pragmas (3)
        KernelTests-Processes (22)
        SUnit-Core-Extensions (3)
        SUnit-Core-Utilities (3)
        SUnit-Tests-Core (77)

----------------------------------------------------------
Loaded Source:  
SLICE-Issue-4780-Unify-union-difference-intersection-on-Collections-CamilloBruni.6  
from http://ss3.gemstone.com/ss/PharoInbox
Tested using Pharo-1.4-14172-a on Croquet Closure Stack VM  
[StackInterpreter VMMaker-oscog-EstebanLorenzano.109] 21.0


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4780 in pharo: Unify union / difference / intersection on Collections

pharo

Comment #25 on issue 4780 by [hidden email]: Unify union /  
difference / intersection on Collections
http://code.google.com/p/pharo/issues/detail?id=4780

In general we like the idea. Perhaps some methods could be implemented in a  
simpler way by maintaining the original simple idea. For example (passes  
all tests):

difference: aCollection
        "Answer the set theoretic difference of two collections."

        ^ self class withAll: (self asSet reject: [:each | aCollection includes:  
each]) asArray

instead of:

| set|
       
        set := self asSet.
        aCollection do: [ :each|
                set remove: each ifAbsent: []].
       
        ^ self class withAll: set asArray

Javier.



_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4780 in pharo: Unify union / difference / intersection on Collections

pharo

Comment #26 on issue 4780 by [hidden email]: Unify union /  
difference / intersection on Collections
http://code.google.com/p/pharo/issues/detail?id=4780

And don't forget to remove the Transcript debug code also!


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4780 in pharo: Unify union / difference / intersection on Collections

pharo
Updates:
        Status: ReviewNeeded

Comment #27 on issue 4780 by [hidden email]: Unify union /  
difference / intersection on Collections
http://code.google.com/p/pharo/issues/detail?id=4780

(No comment was entered for this change.)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4780 in pharo: Unify union / difference / intersection on Collections

pharo
Updates:
        Status: FixReviewNeeded

Comment #28 on issue 4780 by [hidden email]: Unify union /  
difference / intersection on Collections
http://code.google.com/p/pharo/issues/detail?id=4780

(No comment was entered for this change.)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4780 in pharo: Unify union / difference / intersection on Collections

pharo

Comment #29 on issue 4780 by [hidden email]: Unify union /  
difference / intersection on Collections
http://code.google.com/p/pharo/issues/detail?id=4780

merged with the latest version and removed the Transcript


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4780 in pharo: Unify union / difference / intersection on Collections

pharo

Comment #30 on issue 4780 by [hidden email]: Unify union /  
difference / intersection on Collections
http://code.google.com/p/pharo/issues/detail?id=4780

remainder for Camillo: look at Collection>>intersection:
for improving it:


intersection: aCollection
        "Answer the set theoretic intersection of two collections."

        | set outputSet |
       
        set := self asSet.
        outputSet := Set new.
       
        aCollection do: [ :each|
                ((set includes: each) and: [(outputSet includes: each) not])
                        ifTrue: [
                                outputSet add: each]].

[ ^ self class withAll: outputSet asArray ] on: Error do: [ :err|
                ^ self class new: self size streamContents: [ :stream|
                        outputSet do: [ :each| stream nextPut: each ]]].


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4780 in pharo: Unify union / difference / intersection on Collections

pharo

Comment #31 on issue 4780 by [hidden email]: Unify union /  
difference / intersection on Collections
http://code.google.com/p/pharo/issues/detail?id=4780

simplified the implementation of Collection >> #intersection:

see

SLICE-Issue-4780-Unify-union-difference-intersection-on-Collections-CamilloBruni.9


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4780 in pharo: Unify union / difference / intersection on Collections

pharo
Updates:
        Status: FixToInclude

Comment #32 on issue 4780 by [hidden email]: Unify union /  
difference / intersection on Collections
http://code.google.com/p/pharo/issues/detail?id=4780

Looks good. Tests are green for collections after.


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4780 in pharo: Unify union / difference / intersection on Collections

pharo
Updates:
        Status: Integrated

Comment #33 on issue 4780 by [hidden email]: Unify union /  
difference / intersection on Collections
http://code.google.com/p/pharo/issues/detail?id=4780

in 14380


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
12