bugs with SmallDictionary #scanFor:

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

bugs with SmallDictionary #scanFor:

cdelaunay
SmallDictionary, unlike all subclasses of Dictionary, never used ( and initialize ) the instance variable: 'array'.
Associations are stored with a key array ( called 'keys' ) and a value array ( 'values' ).
Problem is that the method #scanFor: is define in Dictionary ( and not overriden ) with this code :

scanFor: anObject
| element start finish |
finish := array size.
        ....

'array' is  nil and it cause bugs for those methods :

-> #includesAssociation:
-> #associationAt:
-> #associationAt:ifAbsent:
-> #associationDeclareAt:


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

Re: bugs with SmallDictionary #scanFor:

Lukas Renggli
I think SmallDictionary should be removed from the core. There are no users.

Lukas

2009/7/3 Cyrille Delaunay <[hidden email]>:

> SmallDictionary, unlike all subclasses of Dictionary, never used ( and
> initialize ) the instance variable: 'array'.
> Associations are stored with a key array ( called 'keys' ) and a value array
> ( 'values' ).
> Problem is that the method #scanFor: is define in Dictionary ( and not
> overriden ) with this code :
> scanFor: anObject
> | element start finish |
> finish := array size.
>         ....
> 'array' is  nil and it cause bugs for those methods :
> -> #includesAssociation:
> -> #associationAt:
> -> #associationAt:ifAbsent:
> -> #associationDeclareAt:
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Lukas Renggli
http://www.lukas-renggli.ch

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

Re: bugs with SmallDictionary #scanFor:

Damien Cassou
In reply to this post by cdelaunay
2009/7/3 Cyrille Delaunay <[hidden email]>:

> SmallDictionary, unlike all subclasses of Dictionary, never used ( and
> initialize ) the instance variable: 'array'.
> Associations are stored with a key array ( called 'keys' ) and a value array
> ( 'values' ).
> Problem is that the method #scanFor: is define in Dictionary ( and not
> overriden ) with this code :
> scanFor: anObject
> | element start finish |
> finish := array size.
>         ....
> 'array' is  nil and it cause bugs for those methods :
> -> #includesAssociation:
> -> #associationAt:
> -> #associationAt:ifAbsent:
> -> #associationDeclareAt:

Please have a look at
http://code.google.com/p/pharo/issues/detail?id=463 and comment.

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Lambdas are relegated to relative obscurity until Java makes them
popular by not having them." James Iry

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

Re: bugs with SmallDictionary #scanFor:

Stéphane Ducasse
In reply to this post by Lukas Renggli
May be cyrille the best way would be to:
rewrite small dictionary using the double arrays and to do it from  
scratch.
I do not know if you want to do that but it could be fun to see if it  
goes
faster than a dictionary for a small sets of items. Since it was  
designed for that.
lukas told me that this class is coming from the refactoringBrowser on  
VW.

Stef


> I think SmallDictionary should be removed from the core. There are  
> no users.
>
> Lukas
>
> 2009/7/3 Cyrille Delaunay <[hidden email]>:
>> SmallDictionary, unlike all subclasses of Dictionary, never used  
>> ( and
>> initialize ) the instance variable: 'array'.
>> Associations are stored with a key array ( called 'keys' ) and a  
>> value array
>> ( 'values' ).
>> Problem is that the method #scanFor: is define in Dictionary ( and  
>> not
>> overriden ) with this code :
>> scanFor: anObject
>> | element start finish |
>> finish := array size.
>>         ....
>> 'array' is  nil and it cause bugs for those methods :
>> -> #includesAssociation:
>> -> #associationAt:
>> -> #associationAt:ifAbsent:
>> -> #associationDeclareAt:
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
>
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


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

Re: bugs with SmallDictionary #scanFor:

Damien Cassou
On Fri, Jul 3, 2009 at 4:03 PM, Stéphane
Ducasse<[hidden email]> wrote:
> May be cyrille the best way would be to:
> rewrite small dictionary using the double arrays and to do it from
> scratch.
> I do not know if you want to do that but it could be fun to see if it
> goes
> faster than a dictionary for a small sets of items. Since it was
> designed for that.
> lukas told me that this class is coming from the refactoringBrowser on
> VW.

It seems that SmallDictionary has been removed from Pharo.

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Lambdas are relegated to relative obscurity until Java makes them
popular by not having them." James Iry

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

Re: bugs with SmallDictionary #scanFor:

Stéphane Ducasse
not yet

Stef
On Jul 4, 2009, at 3:59 PM, Damien Cassou wrote:

> On Fri, Jul 3, 2009 at 4:03 PM, Stéphane
> Ducasse<[hidden email]> wrote:
>> May be cyrille the best way would be to:
>> rewrite small dictionary using the double arrays and to do it from
>> scratch.
>> I do not know if you want to do that but it could be fun to see if it
>> goes
>> faster than a dictionary for a small sets of items. Since it was
>> designed for that.
>> lukas told me that this class is coming from the refactoringBrowser  
>> on
>> VW.
>
> It seems that SmallDictionary has been removed from Pharo.
>
> --
> Damien Cassou
> http://damiencassou.seasidehosting.st
>
> "Lambdas are relegated to relative obscurity until Java makes them
> popular by not having them." James Iry
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


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