Issue 241 in glassdb: GsPharo-Core does not implement Collection>>#groupedBy:

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

Issue 241 in glassdb: GsPharo-Core does not implement Collection>>#groupedBy:

glassdb
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium GLASS-Server Version-GLASS0.231

New issue 241 by [hidden email]: GsPharo-Core does not implement  
Collection>>#groupedBy:
http://code.google.com/p/glassdb/issues/detail?id=241

To implement Collection>>#groupedBy: you need the following methods from  
Pharo:

Collection>>#groupedBy: aBlock

groupedBy: aBlock
     "Answer a dictionary whose keys are the result of evaluating aBlock
     for all my elements, and the value for each key is the selection of
     my elements that evaluated to that key. Uses species."
     | groups |
     groups := PluggableDictionary integerDictionary.
     self do: [ :each |
         (groups at: (aBlock value: each) ifAbsentPut: [ OrderedCollection  
new
]) add: each ].
     self species ~~ OrderedCollection ifTrue: [
         groups associationsDo: [ :association |
             association value: (self species withAll: association value) ]].
     ^ groups


PluggableDictionary class>>#integerDictionary
integerDictionary
     ^ self new hashBlock: [:integer | integer hash \\ 1064164 * 1009]



Reply | Threaded
Open this post in threaded view
|

Re: Issue 241 in glassdb: GsPharo-Core does not implement Collection>>#groupedBy:

glassdb
Updates:
        Status: Accepted
        Owner: [hidden email]
        Labels: -Version-GLASS0.231 Version-1.0-beta.8.5 Milestone-1.0-beta.8.6

Comment #1 on issue 241 by [hidden email]: GsPharo-Core does not  
implement Collection>>#groupedBy:
http://code.google.com/p/glassdb/issues/detail?id=241

(No comment was entered for this change.)

Reply | Threaded
Open this post in threaded view
|

Re: Issue 241 in glassdb: GsPharo-Core does not implement Collection>>#groupedBy:

glassdb
Updates:
        Status: Fixed
        Labels: Fixed-1.0-beta.8.7

Comment #2 on issue 241 by [hidden email]: GsPharo-Core does not  
implement Collection>>#groupedBy:
http://code.google.com/p/glassdb/issues/detail?id=241

groupedBy: and groupedBy:having: added to GsPharo package (not present in  
Squeak):

Name: ConfigurationOfGsPharo-dkh.10
Author: dkh
Time: 03/23/2011, 15:39:36
UUID: 84ca17fc-aff4-43f3-8b80-809efb62bd18
Ancestors: ConfigurationOfGsPharo-DaleHenrichs.9

add #integerDictionary to Squeak package (That's where PluggableDictionary  
already resides):

Name: ConfigurationOfGsCore-dkh.183
Author: dkh
Time: 03/23/2011, 15:39:02
UUID: 3f877a5a-0508-489a-b34b-a919c2e092f5
Ancestors: ConfigurationOfGsCore-dkh.182