Symbol and String next level

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

Symbol and String next level

NorbertHartl
i really have trouble finding a strategy how to deal with symbols and strings in overall. New in the mix of confusions is SymbolAssociation.

To make it short

| d |
d := IdentityDictionary new.
d at: #a put: 'b'.
d associations first = (#a -> 'b')

gives false. I know why but I don't know how to handle code that is using something that produces this. I found this while porting the xml parser. For testing we like to use includesAllOf: in a collection which fails because there are Associations and SymbolAssociations.

A few words of advize would be great

Norbert
Reply | Threaded
Open this post in threaded view
|

Re: Symbol and String next level

Dale
Norbert,

When I look at the code, I think that it is just plain wrong. I've submitted an issue on this (http://code.google.com/p/glassdb/issues/list?thanks=60&ts=1267724438).

I am interested in other opinions, but I would think that it is safe to remove the class test in Association>>= and then you'll get the behavior that you expect.

Dale
----- "Norbert Hartl" <[hidden email]> wrote:

| i really have trouble finding a strategy how to deal with symbols and
| strings in overall. New in the mix of confusions is
| SymbolAssociation.
|
| To make it short
|
| | d |
| d := IdentityDictionary new.
| d at: #a put: 'b'.
| d associations first = (#a -> 'b')
|
| gives false. I know why but I don't know how to handle code that is
| using something that produces this. I found this while porting the xml
| parser. For testing we like to use includesAllOf: in a collection
| which fails because there are Associations and SymbolAssociations.
|
| A few words of advize would be great
|
| Norbert