It certainly is not a generally applicable method for Dictionary (not all/most 
keys will not understand #beginsWith:), but for some senders, it might make 
sense, as it (I think) does for SystemDictionary.  It would bother me less as a 
loose method packaged as part of something that "needs" it, but I would be 
inclined to deprecate/clean it if it is intended as part of the collection 
protocol.  Clients/senders could always define something like 
#dictionary:hasKeyBeginningWith:.

One of the great things about Smalltalk is the ability to add methods to system 
classes.  This is probably not the best use of that freedom.  Has this been of 
_any_ help? :)

Bill



________________________________
From: pharo-project-boun...@lists.gforge.inria.fr 
[mailto:pharo-project-boun...@lists.gforge.inria.fr] On Behalf Of David Goehrig
Sent: Wednesday, July 08, 2009 12:33 PM
To: Pharo-project@lists.gforge.inria.fr
Subject: Re: [Pharo-project] doing bad things to Dictionaries.

On Wed, Jul 8, 2009 at 1:06 PM, Michael Roberts 
<m...@mjr104.co.uk<mailto:m...@mjr104.co.uk>> wrote:
Why do you assume all keys of dictionarys understand beginsWith: ?

I don't. Someone else did.  I just added a nil check to the code.  There's 
probably bigger issues with this code.

Dave

--
-=-=-=-=-=-=-=-=-=-=- http://blog.dloh.org/
_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to