jonkelly at fastmail.fm
Thu Dec 31 19:00:41 CST 2015
On 01-Jan-16 11:32 AM, Phil (list) wrote:
> On Fri, 2016-01-01 at 09:47 +1100, Jonathan Kelly via Cuis-dev wrote:
>> On 01-Jan-16 6:47 AM, Phil (list) via Cuis-dev wrote:
>>> An Association is just an implementation detail (i.e. the storage
>>> mechanism the Dictionary uses), all the Dictionary promises to do
>>> store an arbitrary object given a distinct key value (as determined
>>> #=), not distinct Associations. It doesn't promise to use the
>>> Association, or even the key, you pass it. This is actually what
>>> people want it do do the majority of the time. If what you need is
>>> distinctiveness test to be based on the key identity, then you use
>>> IdentityDictionary (which uses #==) If you look at #scanFor: in
>>> *Dictionary classes you'll see the difference and notice that
>>> one cares about the Association, only its key. If what you are
>>> for is a collection of unique associations, then what you probably
>>> to use is an IdentitySet for your associations.
>>>> - Dan
>>>> Cuis-dev mailing list
>>>> Cuis-dev at cuis-smalltalk.org
>>> Cuis-dev mailing list
>>> Cuis-dev at cuis-smalltalk.org
>> Have you heard of the term "defensive programming"?
>> You've made a case, but how would anyone know that is the intended
>> (devalued) usage of Associations?
> I had a long and opinionated piece ready to click send on but then I
> streamlined :-)
> I suggested the devalued status of methods dealing with Associations
> based on a previous experience in Cuis with Dictionary and Association.
> It isn't officially devalued or deprecated, but 'feels' to me like
> something that could easily disappear at some point based on my
> previous experience.
If anyone is making book on that, I'll take a very large slice of
"that's never going to happen". lol
More information about the Cuis-dev