[Pharo-project] bugs with SmallDictionary #scanFor:
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:
I think SmallDictionary should be removed from the core. There are no users. Lukas 2009/7/3 Cyrille Delaunay <cy.delaunay@gmail.com>:
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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Lukas Renggli http://www.lukas-renggli.ch
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 <cy.delaunay@gmail.com>:
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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Lukas Renggli http://www.lukas-renggli.ch
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
On Fri, Jul 3, 2009 at 4:03 PM, Stéphane Ducasse<stephane.ducasse@inria.fr> 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
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<stephane.ducasse@inria.fr> 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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
2009/7/3 Cyrille Delaunay <cy.delaunay@gmail.com>:
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
participants (4)
-
Cyrille Delaunay -
Damien Cassou -
Lukas Renggli -
Stéphane Ducasse