Index: mlc/bool.hh
===================================================================
--- mlc/bool.hh	(revision 130)
+++ mlc/bool.hh	(working copy)
@@ -31,19 +31,19 @@
 # include <mlc/value.hh>
 
 
+/// Macro that retrieves a Boolean value from a static type representing a Boolean.
+# define mlc_bool(Type)  mlc::internal::helper_get_bool< Type >::ret
+
+
 namespace mlc
 {
 
-  struct Boolean_value
-  {
-  };
-
   /// Specializations of mlc::value for T = bool; when v = true, ensure() is provided.
 
   template <>
-  struct value <bool, true> : public Boolean_value
+  struct value <bool, true>
   {
-    static const bool b   = true;
+    static const bool Boolean_value = true;
     static const bool val = true;
     static void ensure() {}
   protected:
@@ -51,9 +51,9 @@
   };
 
   template <>
-  struct value <bool, false> : public Boolean_value
+  struct value <bool, false>
   {
-    static const bool b   = false;
+    static const bool Boolean_value = false;
     static const bool val = false;
   protected:
     value() {}
@@ -65,8 +65,22 @@
   typedef value<bool, false> false_type;
 
 
-  /// Classes is_true<b> and is_false<b> (provided for bkd compability).
+  namespace internal
+  {
 
+    template <typename T>
+    struct helper_get_bool
+    {
+      // FIXME: static check that T dderives from either true_type or false_type...
+      static const bool ret = T::Boolean_value;
+    };
+
+  } // end of namespace mlc::internal
+
+  
+
+  /// Classes is_true<b> and is_false<b> (only provided for bkd compability).
+
   template <bool b> struct is_true {};
   template <> struct is_true <true> { static void ensure() {} };
 
@@ -78,19 +92,19 @@
   /// Logical unary not of a Boolean type
 
   template <typename T>
-  struct not_ : public value<bool, !T::b>
+  struct not_ : public value<bool, !mlc_bool(T)>
   {
     // FIXME: static assert here and below s.a. ~not_() { mlc_is_a(not_<T>, Boolean_value); }
   };
 
   /// Logical binary operators between a couple of Boolean types
 
-  template <typename L, typename R> struct and_  : public value <bool,   (L::b && R::b) > {};
-  template <typename L, typename R> struct nand_ : public value <bool, (!(L::b && R::b))> {}; 
-  template <typename L, typename R> struct or_   : public value <bool,   (L::b || R::b) > {};
-  template <typename L, typename R> struct nor_  : public value <bool, (!(L::b || R::b))> {};
-  template <typename L, typename R> struct xor_  : public value <bool,   (L::b != R::b) > {};
-  template <typename L, typename R> struct xnor_ : public value <bool, (!(L::b != R::b))> {};
+  template <typename L, typename R> struct and_  : public value <bool,   (mlc_bool(L) && mlc_bool(R)) > {};
+  template <typename L, typename R> struct nand_ : public value <bool, (!(mlc_bool(L) && mlc_bool(R)))> {}; 
+  template <typename L, typename R> struct or_   : public value <bool,   (mlc_bool(L) || mlc_bool(R)) > {};
+  template <typename L, typename R> struct nor_  : public value <bool, (!(mlc_bool(L) || mlc_bool(R)))> {};
+  template <typename L, typename R> struct xor_  : public value <bool,   (mlc_bool(L) != mlc_bool(R)) > {};
+  template <typename L, typename R> struct xnor_ : public value <bool, (!(mlc_bool(L) != mlc_bool(R)))> {};
 
 } // end of namespace mlc
 
Index: mlc/properties.hh
===================================================================
--- mlc/properties.hh	(revision 130)
+++ mlc/properties.hh	(working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2001, 2002, 2003, 2004, 2005 EPITA Research and Development Laboratory
+// Copyright (C) 2005 EPITA Research and Development Laboratory
 //
 // This file is part of the Olena Library.  This library is free
 // software; you can redistribute it and/or modify it under the terms
@@ -28,195 +28,205 @@
 #ifndef METALIC_PROPERTIES_HH
 # define METALIC_PROPERTIES_HH
 
-# include <iostream>
-# include <typeinfo>
-
+# include <mlc/types.hh>
+# include <mlc/typedef.hh>
+# include <mlc/bool.hh>
+# include <mlc/implies.hh>
+# include <mlc/cmp.hh>
 # include <mlc/if.hh>
-# include <mlc/cmp.hh>
-# include <mlc/types.hh>
+# include <mlc/is_a.hh>
 
 
+// this is an internal macro
+# define mlc_internal_get_typedef_(FromType, TypedefType) \
+  typename internal::get_typedef <FromType, TypedefType> ::ret
 
-/// macro to equip a namespace for properties:
 
-# define mlc_equip_namespace_for_properties()					\
+
+# define mlc_equip_namespace_with_properties()					\
 										\
-  template <typename T>								\
-  struct set_category								\
+  mlc_equip_namespace_with_typedef();						\
+  mlc_decl_typedef(ret);							\
+										\
+  template <template <typename> class abstraction>				\
+  struct is_a									\
   {										\
-    typedef mlc::undefined_type ret;						\
+    template <typename E>							\
+    struct instantiated_with							\
+    {										\
+      typedef abstraction<E> ret;						\
+    };										\
   };										\
 										\
-  template <typename T>								\
+  template <typename type, unsigned i = 0>					\
   struct set_super_type								\
   {										\
     typedef mlc::no_type ret;							\
   };										\
 										\
-  template <typename category, typename type>					\
-  struct set_props								\
+  template <typename type, unsigned i = 0>					\
+  struct set_category								\
   {										\
-    typedef mlc::false_type user_defined_;					\
+    typedef mlc::no_type ret;							\
   };										\
 										\
-  template <typename category, typename kind = mlc::no_type>			\
-  struct props_of								\
+  template <typename category>							\
+  struct set_default_props							\
   {										\
   };										\
 										\
   template <typename category, typename type>					\
-  struct get_props : public props_of <category, type>				\
+  struct set_props								\
   {										\
   };										\
 										\
-  template <typename category, typename from_type, typename target>		\
-  struct set_type_of								\
+  template <typename category, typename type>					\
+  struct get_props								\
   {										\
-    typedef mlc::undefined_type ret;						\
   };										\
 										\
-  template <typename category, typename from_type, typename target>		\
-  struct get_type_of : public set_type_of <category, from_type, target>		\
+  template <typename category, typename from_type, typename typedef_type>	\
+  struct set_type								\
   {										\
   };										\
 										\
   namespace internal								\
   {										\
-    template <typename T>							\
-    struct get_category : public set_category <T>				\
+										\
+    template <typename type, unsigned i = 0>					\
+    struct get_super_type : public set_super_type <type, i>			\
     {										\
     };										\
-    template <typename T>							\
-    struct get_super_type : public set_super_type <T>				\
+										\
+    template <typename type, unsigned i = 0>					\
+    struct get_category : public set_category <type, i>				\
     {										\
     };										\
 										\
+    template <typename category>						\
+    struct get_default_props : public set_default_props <category>		\
+    {										\
+    };										\
+										\
     template <typename category, typename type>					\
     struct get_props : public set_props <category, type>			\
     {										\
-      /* FIXME: test that user_defined_ is ok */				\
     };										\
 										\
-    template <typename category, typename type, typename target>		\
-    struct get_prop								\
+    template <typename category, typename from_type, typename typedef_type>	\
+    struct get_type : public set_type <category, from_type, typedef_type>	\
     {										\
-      typedef mlc::undefined_type ret;						\
+      ~get_type()								\
+      {										\
+	typedef set_type <category, from_type, typedef_type> super_type;	\
+	typedef mlc_internal_get_typedef_(get_default_props<category>,		\
+					  typedef_type) prop_type;		\
+										\
+	mlc::implies< mlc::neq< mlc_typedef_of(super_type, ret),		\
+	                   mlc::internal::not_found >,				\
+	         mlc::eq< prop_type,						\
+	                  mlc::internal::not_found > >::ensure();		\
+      }										\
     };										\
 										\
-    template <typename category, typename type, typename target,		\
-	      typename is_no_type__type, typename is_user_defined__type>	\
-    struct get_prop_helper							\
+										\
+    template <typename category, typename from_type, typename typedef_type>	\
+    struct f_rec_get_prop							\
     {										\
-      typedef mlc::undefined_type ret;						\
+      typedef get_props<category, from_type> props;				\
+      typedef mlc_internal_get_typedef_(props, typedef_type) prop;		\
+										\
+      typedef typename								\
+      mlc::if_< mlc::neq< prop, mlc::internal::not_found >,			\
+	        prop,								\
+	   typename f_rec_get_prop< category,					\
+				typename get_super_type<from_type, 0>::ret,	\
+				typedef_type >::ret				\
+      >::ret ret;								\
     };										\
 										\
+    template <typename category, typename typedef_type>				\
+    struct f_rec_get_prop <category, mlc::no_type, typedef_type>		\
+    {										\
+      typedef mlc_internal_get_typedef_(get_default_props<category>,		\
+					typedef_type) ret;			\
+      ~f_rec_get_prop()								\
+      {										\
+	mlc::and_< mlc::neq< ret, mlc::internal::not_found >,			\
+	           mlc::neq< ret, mlc::undefined_type > >::ensure();		\
+      }										\
+    };										\
+										\
+										\
+    template <typename category, typename from_type, typename typedef_type>	\
+    struct f_rec_get_type							\
+    {										\
+      typedef get_type<category, from_type, typedef_type> client_type;		\
+      typedef mlc_typedef_of(client_type, ret) type;				\
+										\
+      typedef typename								\
+      mlc::if_< mlc::neq< type, mlc::internal::not_found >,			\
+	   type,								\
+	   typename f_rec_get_type< category,					\
+				typename get_super_type<from_type, 0>::ret,	\
+				typedef_type >::ret				\
+      >::ret ret;								\
+    };										\
+										\
+    template <typename category, typename typedef_type>				\
+    struct f_rec_get_type <category, mlc::no_type, typedef_type>		\
+    {										\
+      typedef mlc::internal::not_found ret;					\
+    };										\
+										\
+    template <typename category, typename from_type, typename typedef_type>	\
+    struct f_get_type								\
+    {										\
+      typedef									\
+      mlc_internal_get_typedef_(get_default_props<category>, typedef_type)	\
+      default_prop;								\
+										\
+      typedef									\
+      typename f_rec_get_prop<category, from_type, typedef_type>::ret		\
+      prop;									\
+										\
+      typedef									\
+      typename f_rec_get_type<category, from_type, typedef_type>::ret		\
+      type;									\
+ 										\
+      ~f_get_type()								\
+      {										\
+	mlc::implies< mlc::is_found<default_prop>,				\
+	              mlc::is_not_found<type> >::ensure();			\
+	mlc::xor_< mlc::is_found<prop>,						\
+	           mlc::is_found<type> >::ensure();				\
+      }										\
+										\
+      typedef typename mlc::if_< mlc::is_found<prop>, prop, type>::ret ret;	\
+    };										\
+										\
   }										\
-void namespace_is_equiped_for_properties()
+										\
+struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
 
 
 
-/// macro to register a property in a props_of<..>:
+# define mlc_type_of_(Namespace, Category, FromType, Alias)				\
+  Namespace::internal::f_get_type<Category,						\
+                                     FromType,						\
+                                     Namespace::internal::typedef_::Alias##_type>::ret
 
-# define mlc_register_prop(CATEGORY, TARGET)						\
-											\
-namespace internal									\
-{											\
-											\
-  template <>										\
-  struct get_prop < CATEGORY, mlc::no_type, target::TARGET >				\
-  {											\
-    typedef props_of<CATEGORY, mlc::default_type>:: TARGET ret;				\
-  };											\
-											\
-  template <typename type>								\
-  struct get_prop < CATEGORY, type, target::TARGET >					\
-  {											\
-    typedef get_prop_helper<CATEGORY, type, target::TARGET,				\
-			      mlc_eq(type, mlc::no_type),				\
-			      typename get_props<CATEGORY, type>::user_defined_		\
-			      > helper_type;						\
-    typedef typename helper_type::ret ret;						\
-  };											\
-  template <typename type>								\
-  struct get_prop_helper < CATEGORY, type, target::TARGET, mlc::false_type,		\
-			     mlc::true_type >						\
-  {											\
-    typedef typename get_props<CATEGORY, type>:: TARGET prop_type;			\
-    typedef typename get_prop<CATEGORY,							\
-                              typename get_super_type<type>::ret,			\
-                              target::TARGET>::ret super_prop_type;			\
-											\
-    typedef typename mlc::if_< typename mlc::eq<prop_type, mlc::unknown_type>::ret,	\
-			      super_prop_type,						\
-			      prop_type >::ret ret;					\
-  };											\
-  template <typename type>								\
-  struct get_prop_helper < CATEGORY, type, target::TARGET, mlc::false_type,		\
-			     mlc::false_type >						\
-  {											\
-    typedef typename get_prop<CATEGORY,							\
-                              typename get_super_type<type>::ret,			\
-                              target::TARGET>::ret ret;					\
-  };											\
-}											\
-											\
-template <typename type>								\
-struct set_type_of < CATEGORY, type, target::TARGET >					\
-{											\
-  typedef typename internal::get_prop<CATEGORY, type, target::TARGET>::ret ret;		\
-}
+# define mlc_type_of(Namespace, Category, FromType, Alias) \
+typename mlc_type_of_(Namespace, Category, FromType, Alias)
 
 
 
-/// internal macro:
+// FIXME: TODO-list
+//
+// f_get_type lance d'une part f_rec_get_prop et d'autre part f_rec_get_type
+// fusion des r�sultats: si 2 not_found err, si 1 ok + 1 not_found -> ok
+//
+// f_rec_get_prop et f_rec_get_type examine plusieurs super (i=0,1,2)
 
-# define mlc_internal_retrieve_prop(CATEGORY, TYPE, TARGET)		\
- typename internal::get_prop<CATEGORY, TYPE, target::TARGET>::ret
 
-
-
-/// macros to declare a property:
-
-# define mlc_decl_prop_with_default(CATEGORY, NAME, DEFAULT)					\
-  typedef typename mlc::if_<typename mlc::eq<type, mlc::default_type>::ret,			\
-			    DEFAULT,								\
-			    typename mlc::if_<typename mlc::eq<type, mlc::no_type>::ret,	\
-					      mlc::unknown_type,				\
-					      mlc_internal_retrieve_prop(CATEGORY, type, NAME)	\
-                                             >::ret						\
-                           >::ret  NAME
-
-# define mlc_decl_prop(CATEGORY, NAME)								\
-  typedef typename mlc::if_<typename mlc::eq<type, mlc::default_type>::ret,			\
-			    mlc::undefined_type,						\
-			    typename mlc::if_<typename mlc::eq<type, mlc::no_type>::ret,	\
-					      mlc::unknown_type,				\
-					      mlc_internal_retrieve_prop(CATEGORY, type, NAME)	\
-                                             >::ret						\
-		           >::ret  NAME
-
-
-
-/// macro to retrieve a type (TARGET) from a class (NAMESPACE::TYPE)
-
-# define mlc_type_of(NAMESPACE, TYPE, TARGET)						\
-typename NAMESPACE::get_type_of<typename NAMESPACE::internal::get_category<TYPE>::ret,	\
-                           TYPE,							\
-                           NAMESPACE::target::TARGET##_type>::ret
-
-# define mlc_type_of_(NAMESPACE, TYPE, TARGET)					\
-NAMESPACE::get_type_of<typename NAMESPACE::internal::get_category<TYPE>::ret,	\
-                           TYPE,						\
-                           NAMESPACE::target::TARGET##_type>::ret
-
-
-/// useful printing macro to debug
-
-# define mlc_print_props(NAMESPACE, TYPE, OSTREAM) \
-NAMESPACE::props_of<typename NAMESPACE::internal::get_category<TYPE>::ret, TYPE>::echo(OSTREAM)
-
-# define mlc_print_props_(NAMESPACE, TYPE, OSTREAM) \
-NAMESPACE::props_of<NAMESPACE::internal::get_category<TYPE>::ret, TYPE>::echo(OSTREAM)
-
-
 #endif // ! METALIC_PROPERTIES_HH
Index: mlc/if.hh
===================================================================
--- mlc/if.hh	(revision 130)
+++ mlc/if.hh	(working copy)
@@ -42,16 +42,16 @@
   {
 
     template <bool b, typename then_type, typename else_type>
-    struct if_;
+    struct fun_if_;
 
     template <typename then_type, typename else_type>
-    struct if_ <true, then_type, else_type>
+    struct fun_if_ <true, then_type, else_type>
     {
       typedef then_type ret;
     };
     
     template <typename then_type, typename else_type>
-    struct if_ <false, then_type, else_type>
+    struct fun_if_ <false, then_type, else_type>
     {
       typedef else_type ret;
     };
@@ -60,7 +60,7 @@
 
 
   template <typename cond_type, typename then_type, typename else_type>
-  struct if_ : public internal::if_ < cond_type::b, then_type, else_type >
+  struct if_ : public internal::fun_if_ < mlc_bool(cond_type), then_type, else_type >
   {
   };
 
Index: mlc/typedef.hh
===================================================================
--- mlc/typedef.hh	(revision 0)
+++ mlc/typedef.hh	(revision 0)
@@ -0,0 +1,133 @@
+// Copyright (C) 2005 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library.  This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.  This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef METALIC_TYPEDEF_HH
+# define METALIC_TYPEDEF_HH
+
+# include <mlc/types.hh>
+
+
+// do not use the macro below if you equip a namespace with properties
+
+# define mlc_equip_namespace_with_typedef()		\
+namespace internal					\
+{							\
+  							\
+  template <typename type, typename typedef_type>	\
+  struct get_typedef					\
+  {							\
+    typedef mlc::internal::not_found ret;		\
+  };							\
+  							\
+}							\
+struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
+
+
+
+
+/*! \macro  mlc_decl_typedef (TypedefName)
+**
+** Macro to equip mlc with a static mechanism for a typedef retrieval.
+**
+** FIXME
+*/
+
+# define mlc_decl_typedef(TypedefName)						\
+namespace  internal								\
+{										\
+										\
+  namespace typedef_								\
+  {										\
+    struct TypedefName;								\
+  }										\
+										\
+  struct helper_get_typedef__##TypedefName					\
+  {										\
+    typedef char yes;								\
+    struct no { char tmp[2]; };							\
+										\
+    template <typename type, typename alias = typename type::TypedefName>	\
+    struct run_on;								\
+										\
+    template <typename type>							\
+    static yes selector(run_on<type>*);						\
+										\
+    template <typename type>							\
+    static no selector(...);							\
+										\
+    template <typename type, bool found>					\
+    struct result;								\
+										\
+    template <typename type>							\
+    struct result <type, true>							\
+    {										\
+      typedef typename type::TypedefName ret;					\
+    };										\
+										\
+    template <typename type>							\
+    struct result <type, false>							\
+    {										\
+      typedef mlc::internal::not_found ret;					\
+    };										\
+  };										\
+										\
+  template <typename type>							\
+  struct get_typedef__##TypedefName						\
+  {										\
+    typedef  helper_get_typedef__##TypedefName  helper_type;			\
+    static const bool found = ( sizeof(helper_type::selector<type>(0)) == 1 );	\
+    typedef typename helper_type::result<type, found>::ret ret;			\
+  };										\
+										\
+  template <typename type>							\
+  struct get_typedef <type, typedef_::TypedefName>				\
+  {										\
+    typedef typename get_typedef__##TypedefName <type> ::ret ret;		\
+  };										\
+										\
+}										\
+struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
+
+
+
+
+
+/*! \macro  mlc_typedef_of( FromType, TypedefName )
+**
+** FIXME
+** Sample use: mlc_typedef_of(vector_t, value_type)
+*/
+# define mlc_typedef_of_(FromType, TypedefName)		\
+							\
+internal::get_typedef__##TypedefName < FromType > ::ret
+
+
+# define mlc_typedef_of(FromType, TypedefName)  typename mlc_typedef_of_(FromType, TypedefName)
+
+
+
+#endif // ! METALIC_TYPEDEF_HH
Index: mlc/implies.hh
===================================================================
--- mlc/implies.hh	(revision 0)
+++ mlc/implies.hh	(revision 0)
@@ -0,0 +1,48 @@
+// Copyright (C) 2005 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library.  This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.  This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef METALIC_IMPLIES_HH
+# define METALIC_IMPLIES_HH
+
+# include <mlc/bool.hh>
+
+
+/// Macro mlc_implies.
+# define mlc_implies(Left_pred, Right_pred)  typename mlc::implies_<(Left_pred), (Right_pred)>::ret
+
+
+namespace mlc
+{
+
+  template <typename L, typename R> struct implies : public value <bool, (!mlc_bool(L) || mlc_bool(R)) > {};
+
+
+} // end of namespace mlc
+
+
+
+#endif // ! METALIC_IMPLIES_HH
Index: mlc/types.hh
===================================================================
--- mlc/types.hh	(revision 130)
+++ mlc/types.hh	(working copy)
@@ -52,6 +52,13 @@
   class default_type { private: default_type(); };
 
 
+  namespace internal
+  {
+    class not_found { private: not_found(); };
+
+  } // end of namespace mlc::internal
+
+
 } // end of namespace mlc
 
 
Index: mlc/to_string.hh
===================================================================
--- mlc/to_string.hh	(revision 0)
+++ mlc/to_string.hh	(revision 0)
@@ -0,0 +1,69 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library.  This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.  This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef METALIC_TO_STRING_HH
+# define METALIC_TO_STRING_HH
+
+# include <iostream>
+# include <string>
+# include <typeinfo>
+
+
+/// Macro
+# define mlc_to_string(Type)  mlc::internal::demangle(typeid(Type).name())
+
+
+namespace mlc
+{
+
+  namespace internal
+  {
+
+    const std::string demangle(const std::string& str)
+    {
+      if (str == "v") return "void";
+      if (str == "b") return "bool";
+      if (str == "c") return "char";
+      if (str == "h") return "unsigned char";
+      if (str == "s") return "short";
+      if (str == "t") return "unsigned short";
+      if (str == "i") return "int";
+      if (str == "j") return "unsigned int";
+      if (str == "l") return "long";
+      if (str == "m") return "unsigned long";
+      if (str == "f") return "float";
+      if (str == "d") return "double";
+      return str;
+    }
+
+  } // end of mlc::internal
+
+}
+
+
+
+#endif // ! METALIC_TO_STRING_HH
Index: mlc/cmp.hh
===================================================================
--- mlc/cmp.hh	(revision 130)
+++ mlc/cmp.hh	(working copy)
@@ -29,11 +29,15 @@
 # define METALIC_CMP_HH
 
 # include <mlc/bool.hh>
+# include <mlc/types.hh>
 
 
-/// Macro mlc_eq.
-# define mlc_eq(T1, T2)  typename mlc::eq<T1, T2>::ret
+/// Macros mlc_eq and mlc_neq.
+# define mlc_eq(T1, T2) mlc::eq<(T1), (T2)>
+# define mlc_neq(T1, T2) mlc::neq<(T1), (T2)>
 
+# define mlc_is_found(T) mlc::is_found<(T)>
+# define mlc_is_not_found(T) mlc::is_not_found<(T)>
 
 
 namespace mlc
@@ -42,35 +46,39 @@
   /// Equality test between a couple of types.
 
   template <typename T1, typename T2>
-  struct eq
+  struct eq : public value<bool, false>
   {
-    typedef false_type ret;
   };
 
   template <typename T>
-  struct eq <T, T>
+  struct eq <T, T> : public value<bool, true>
   {
-    typedef true_type ret;
-    static void ensure() {}
   };
 
-
   /// Inequality test between a couple of types.
 
   template <typename T1, typename T2>
-  struct neq
+  struct neq : public value<bool, true>
   {
-    typedef true_type ret;
-    static void ensure() {}
   };
 
   template <typename T>
-  struct neq <T, T>
+  struct neq <T, T> : public value<bool, false>
   {
-    typedef false_type ret;
   };
 
+  /// Tests is_found and is_not_found (sugar) upon a type.
 
+  template <typename T>
+  struct is_found : public neq <T, internal::not_found>
+  {
+  };
+
+  template <typename T>
+  struct is_not_found : public eq <T, internal::not_found>
+  {
+  };
+
 } // end of namespace mlc
 
 
