Re: [Vala] [Libgee][RFC] Making Map<K, V> a Collection<Map.Entry<K, V> - Was: Libgee's Roadmap proposal



On Thu, Jul 23, 2009 at 10:32 AM, Didier "Ptitjes"<ptitjes free fr> wrote:
Hi list,

I thought a lot about that and I'd like to make the following proposal.

Levi Bard wrote:
Why not rename some of the Map methods (contains => contains_key,
remove => remove_key) and then map the Collection methods as-is with G
== Pair<K,V>?

First my proposal will break the API. Libgee being in its development
phase, I think there is no problem for that.

Libgee 0.2.x release will be available for bug fixes for a while.
Current master branch is going towards 0.3.0. Library so names will be
changed in order to reflect the API/ABI changes. Also there are already
changes pushed in the repo for 0.3.0 that break the API/ABI.

So here is the proposal:

- Renaming Map.remove(K key) in Map.unset(K key)
- Renaming Map.contains(K key) in Map.has(K key)
- Make Map<K, V> inherit from Collection<Map.Entry<K, V>>

Please comment and argue ;)

Could you please explain the rationale behind this change ? What would
be the benefit from  turning a Map into a collection of Pair ? Also
what is the exact benefit from deviating from what other widespread
class libraries use for their containers ?

--
Ali



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]