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
On Wed, Jul 8, 2009 at 1:06 PM, Michael Roberts
<mike@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/