[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary
From: |
Jānis Rūcis |
Subject: |
Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail |
Date: |
Fri, 23 Mar 2007 14:54:45 +0200 |
User-agent: |
Icedove 1.5.0.9 (X11/20061220) |
Stephen Compall wrote:
> I would suggest that addAllAssociations: have the current behavior of
> addAll:, but that would likely lead to confusion, as the relationship
> between addAll: and addAllAssociations: would be precisely the opposite
> of that between do: and associationsDo:. On the other hand,
> associationsDo: is not even part of <abstractDictionary>....
#associationsDo: is not optimal; it says "here's a collection of stuff,
including associations, so lets do something to these associations, but
not other elements", but that's not what really happens.
Same for #do: -- if you see a Dictionary as a Collection of
Associations, being able to iterate over them with #do: seems natural.
Likewise for being able to add a Dictionary to a Dictionary. And
likewise for being able to initialize a Dictionary from an Array, or any
other Collection, of Associations. (Including Dictionary itself.) All
of these things are neither confusing nor useless. Quite the opposite.
I don't see a reason to follow the standard so closely that it would
make for a less useful behaviour.
Let's just remove #do: from Dictionary (say, move its functionality to
#valuesDo:) and do away with the misleading #associationsDo: (whose
functionality will be taken care of by the inherited #do:). Some
incompatibility is a very small price to pay for this.
Jānis
- [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, parasti, 2007/03/20
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Paolo Bonzini, 2007/03/20
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Stephen Compall, 2007/03/22
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Jānis Rūcis, 2007/03/22
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Stephen Compall, 2007/03/22
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Paolo Bonzini, 2007/03/23
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail,
Jānis Rūcis <=
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Paolo Bonzini, 2007/03/23
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Jānis Rūcis, 2007/03/23
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Paolo Bonzini, 2007/03/23
- Re: [Help-smalltalk] Dictionary>>#addAll: fails, Stephen Compall, 2007/03/23
- [Help-smalltalk] Re: Dictionary>>#addAll: fails, Paolo Bonzini, 2007/03/26
- [Help-smalltalk] Re: Dictionary>>#addAll: fails, Stephen Compall, 2007/03/29
- Re: [Help-smalltalk] Re: Dictionary>>#addAll: fails, Paolo Bonzini, 2007/03/30
- [Help-smalltalk] Re: Dictionary>>#addAll: fails, Stephen Compall, 2007/03/29
- [Help-smalltalk] Re: Dictionary>>#addAll: fails, Jānis Rūcis, 2007/03/29
- [Help-smalltalk] Re: Dictionary>>#addAll: fails, Stephen Compall, 2007/03/29