Re: [boost] Re: [indexed_set] revised naming proposal

Hi Pavel, ----- Mensaje original ----- De: Pavel Vozenilek <pavel_vozenilek@hotmail.com> Fecha: Sábado, Abril 10, 2004 11:50 pm Asunto: [boost] Re: [indexed_set] revised naming proposal
"JOAQUIN LOPEZ MU?Z" <joaquin@tid.es> wrote
This is my 2nd proprosal for naming of the library formerly known as Boost.IndexedSet.
It may be helpful to add examples for each suggested name, for easier orientation.
With pleasure: NAMESPACE+CONTAINER NAME Current: namespace boost{ namespace indexed_sets{ template<...> class indexed_set; } using indexed_sets::indexed_set; } Proposed: namespace boost{ namespace multi_index{ template<...> class indexed_container; } using multi_index::indexed_container; } INDEX NAMING Current: typedef indexed_set< employee, index_list< unique<identity<employee> >, non_unique<member<employee,int,&employee:age> >, sequenced<>
employee_set;
Proposed: typedef indexed_container< employee, index_list< ordered_unique<identity<employee> >, ordered_non_unique<member<employee,int,&employee:age> >, sequenced<>
employee_set;
NTH_INDEX_TYPE AND FAMILIY Current: typedef index_type<indexed_t,some_tag>::type index_t; typedef nth_index_type<indexed_t,n>::type index_t2; typedef indexed_t::index_type<some_tag>::type index_t3; typedef indexed_t::nth_index_type<n>::type index_t4; typedef iterator_type<indexed_t,some_tag>::type iterator_t; typedef nth_iterator_type<indexed_t,n>::type iterator_t2; etc. Proposed: typedef index<indexed_t,some_tag>::type index_t; typedef nth_index<indexed_t,n>::type index_t2; typedef indexed_t::index<some_tag>::type index_t3; typedef indexed_t::nth_index<n>::type index_t4; typedef index_iterator<indexed_t,some_tag>::type iterator_t; typedef nth_index_iterator<indexed_t,n>::type iterator_t2; etc. UPDATE MEMFUN Current: employee_set es; es.update(it,new_value); Proposed: employee_set es; es.replace(it,new_value); Best, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

On Sun, 11 Apr 2004 19:38:29 +0200, JOAQUIN LOPEZ MU?Z wrote I'm good with everything in the proposal, except I think the library should still be called multi-index containers. I think if you leave that out people are likely to miss the fact that the library provides replacement containers. Jeff

"JOAQUIN LOPEZ MU?Z" <joaquin@tid.es> wrote in message news:31c83531e9c8.31e9c831c835@tid.es...
namespace boost{ namespace multi_index{ template<...> class indexed_container; } using multi_index::indexed_container; }
I think multi_indexed_container (or multi_index_container) would be a better name. A long name doesn't hurt here since the container will take some lines to setup with typedef etc anyway. Then the class could be in the boost namespace and there could be a helper namespace, index, which stored the index_list, unique etc. This would make the setup of the container look quite good IMO: typedef multi_indexed_container< employee, index::index_list< index::ordered_unique<index::identity<employee> >, index::ordered_non_unique<index::member<employee,int,&employee:age> >, index::sequenced<>
employee_set;
Before I wasn't sure where member, identity etc came from. br Thorsten

From: "Thorsten Ottosen" <nesotto@cs.auc.dk>
"JOAQUIN LOPEZ MU?Z" <joaquin@tid.es> wrote in message news:31c83531e9c8.31e9c831c835@tid.es...
namespace boost{ namespace multi_index{ template<...> class indexed_container; } using multi_index::indexed_container; }
I think multi_indexed_container (or multi_index_container) would be a better name. A long name doesn't hurt here since the container will take some lines to setup with typedef etc anyway.
Then the class could be in the boost namespace and there could be a helper namespace, index, which stored the index_list, unique etc.
This would make the setup of the container look quite good IMO:
typedef multi_indexed_container< employee, index::index_list< ^^^^^^^^^^
Why not just "index::list?"
index::ordered_unique<index::identity<employee> >, index::ordered_non_unique<index::member<employee,int,&employee:age> >, index::sequenced<>
employee_set;
Before I wasn't sure where member, identity etc came from.
It was the same namespace before, but I very much like your suggestion. The lingering question in my mind is whether your "index" namespace should be called "multi_index." That would tie the namespace to the class better and means that the library could be called Boost.MultiIndex without leading to confusion. -- Rob Stewart stewart@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;

Rob Stewart ha escrito:
From: "Thorsten Ottosen" <nesotto@cs.auc.dk>
"JOAQUIN LOPEZ MU?Z" <joaquin@tid.es> wrote in message news:31c83531e9c8.31e9c831c835@tid.es...
namespace boost{ namespace multi_index{ template<...> class indexed_container; } using multi_index::indexed_container; }
I think multi_indexed_container (or multi_index_container) would be a better name. A long name doesn't hurt here since the container will take some lines to setup with typedef etc anyway.
Then the class could be in the boost namespace and there could be a helper namespace, index, which stored the index_list, unique etc.
This would make the setup of the container look quite good IMO:
typedef multi_indexed_container< employee, index::index_list< ^^^^^^^^^^
Why not just "index::list?"
"list" seems too terse to me. It could lead the reader to think it is some sort of container (which is not). Take into account the namespace can be populated in the future with other containers derived from the main one.
index::ordered_unique<index::identity<employee> >, index::ordered_non_unique<index::member<employee,int,&employee:age> >, index::sequenced<>
employee_set;
Before I wasn't sure where member, identity etc came from.
It was the same namespace before, but I very much like your suggestion. The lingering question in my mind is whether your "index" namespace should be called "multi_index." That would tie the namespace to the class better and means that the library could be called Boost.MultiIndex without leading to confusion.
FWIW, I too prefer multi_index. boost::index seems way too generic a name for a library of multi-indexed containers (specially if we don't move inside boost::container.) To sum it up, my 2nd proposal was: namespace boost::multi_index, container boost::indexed_container and Thorten's, with your proposed refinements, is namespace boost::multi_index, container boost::multi_index_container So it all boils down to choosing between indexed_container/multi_index_container. No strong opinions from my part here. There's still the pending issue of whether to move into boost::container. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

From: =?iso-8859-1?Q?Joaqu=EDn=20M=AA=20L=F3pez=20Mu=F1oz?= <joaquin@tid.es>
Rob Stewart ha escrito:
From: "Thorsten Ottosen" <nesotto@cs.auc.dk>
typedef multi_indexed_container< employee, index::index_list<
^^^^^^^^^^
Why not just "index::list?"
"list" seems too terse to me. It could lead the reader to think it is some sort of container (which is not). Take into account the namespace can be populated in the future with other containers derived from the main one.
I suppose in a given use case, a "using boost::index" (or "using boost::multi_index") may be in force, so it would boil down to just "list." However, neither "index_list" nor "list" really says the right thing. How about turning it around: list_index?
index::ordered_unique<index::identity<employee> >, index::ordered_non_unique<index::member<employee,int,&employee:age> >, index::sequenced<>
employee_set;
Before I wasn't sure where member, identity etc came from.
It was the same namespace before, but I very much like your suggestion. The lingering question in my mind is whether your "index" namespace should be called "multi_index." That would tie the namespace to the class better and means that the library could be called Boost.MultiIndex without leading to confusion.
FWIW, I too prefer multi_index. boost::index seems way too generic a name for a library of multi-indexed containers (specially if we don't move inside boost::container.)
To sum it up, my 2nd proposal was:
namespace boost::multi_index, container boost::indexed_container
and Thorten's, with your proposed refinements, is
namespace boost::multi_index, container boost::multi_index_container
So it all boils down to choosing between indexed_container/multi_index_container. No strong opinions
I agree with Thorsten's proposal. "multi_index_container" is much clearer.
from my part here. There's still the pending issue of whether to move into boost::container.
I think the argument that "a" container library has to be the first one is valid, but was there sufficient consensus that such a namespace was warranted? If there is consensus, your library is a perfect candidate. If there isn't, it would be painful to put your library in the "container" namespace only to rip it out later. If you don't do it and folks agree it is worthwhile, then yours would be just one more library to move into the namespace at that time. -- Rob Stewart stewart@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;
participants (5)
-
Jeff Garland
-
JOAQUIN LOPEZ MU?Z
-
Joaquín Mª López Muñoz
-
Rob Stewart
-
Thorsten Ottosen