[bug] MappedCollection >> #keysDo: does not work as expected

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

[bug] MappedCollection >> #keysDo: does not work as expected

Sam Phillips
Issue status update for
http://smalltalk.gnu.org/node/231
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/231

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    Base classes
 Category:     bug reports
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  sdp
 Updated by:   sdp
 Status:       active

I'm uncertain if this is the proper behavior for this or not, but when
you perform #keysDo: on a MappedCollection you get the mapped key
values
which are different from the response from #keys.

Example:


st> d := Dictionary from: { #aaa -> 1. #bbb -> 2. #ccc -> 4}
Dictionary (
        #aaa->1
        #bbb->2
        #ccc->4
)
st> m := MappedCollection collection: (Array new: 4) map: d
MappedCollection (nil nil nil )
st> m keys
Set (#aaa #bbb #ccc )
st> m keysDo: [:k | k displayNl ]
1
2
4
MappedCollection (nil nil nil )





_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [bug] MappedCollection >> #keysDo: does not work as expected

Nicolas Cellier-3
Sam Phillips a écrit :

> Issue status update for http://smalltalk.gnu.org/node/231
> Post a follow up: http://smalltalk.gnu.org/project/comments/add/231
>
> Project:      GNU Smalltalk
> Version:      <none>
> Component:    Base classes
> Category:     bug reports
> Priority:     normal
> Assigned to:  Unassigned
> Reported by:  sdp
> Updated by:   sdp
> Status:       active
>
> I'm uncertain if this is the proper behavior for this or not, but when
> you perform #keysDo: on a MappedCollection you get the mapped key
> values
> which are different from the response from #keys.
>
> Example:
>
>
> st> d := Dictionary from: { #aaa -> 1. #bbb -> 2. #ccc -> 4}
> Dictionary (
>        #aaa->1
>        #bbb->2
>        #ccc->4
> )
> st> m := MappedCollection collection: (Array new: 4) map: d
> MappedCollection (nil nil nil )
> st> m keys
> Set (#aaa #bbb #ccc )
> st> m keysDo: [:k | k displayNl ]
> 1
> 2
> 4
> MappedCollection (nil nil nil )

I would expect (m keysDo: ) to behave as (m keys do: )



_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [bug] MappedCollection >> #keysDo: does not work as expected

Paolo Bonzini-3
In reply to this post by Sam Phillips
Issue status update for
http://smalltalk.gnu.org/project/issue/231
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/231

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    Base classes
 Category:     bug reports
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  sdp
 Updated by:   bonzinip
 Status:       active

fixed in 8f27a7f, thanks.  MappedCollection >> #keysDo: should send
#keysDo: (not #do:) to the map.




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [bug] MappedCollection >> #keysDo: does not work as expected

Paolo Bonzini-3
In reply to this post by Sam Phillips
Issue status update for
http://smalltalk.gnu.org/project/issue/231
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/231

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    Base classes
 Category:     bug reports
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  sdp
 Updated by:   bonzinip
-Status:       active
+Status:       fixed

fixed in 8f27a7f, thanks.  MappedCollection >> #keysDo: should send
#keysDo: (not #do:) to the map.




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk