Index: oln/funobj/invert.hh
===================================================================
--- oln/funobj/invert.hh	(revision 259)
+++ oln/funobj/invert.hh	(working copy)
@@ -29,9 +29,8 @@
 # define OLENA_FUNOBJ_INVERT_HH
 
 # include <mlc/contract.hh>
-
 # include <ntg/all.hh>
-
+# include <oln/basics.hh>
 # include <oln/core/gen/internal/value_box.hh>
 
 namespace oln {
@@ -40,6 +39,9 @@
 
     // FIXME: funobj::invert should be turned into a f_::invert
     // functor.
+
+    // FIXME: funobj::invert should have a SINGLE meaning!
+    // (not: either -x or 1/x or min<->max or?)
    struct invert
     {
       template <typename V>
@@ -76,7 +78,7 @@
       typename value_box<I>::value_type
       operator()(const value_box<I>& v) const
       {
-	return operator()(v.value());
+	return this->operator()(v.value());
       }
 
       invert() {}
Index: oln/core/abstract/point.hh
===================================================================
--- oln/core/abstract/point.hh	(revision 259)
+++ oln/core/abstract/point.hh	(working copy)
@@ -202,6 +202,22 @@
 
   } // end of namespace abstract
 
+
+  // FIXME: read FIXME in oln/core/abstract/size.hh ...
+
+//   namespace internal
+//   {
+
+//     template <typename P>
+//     bool operator_eq(const oln::abstract::point<P>& lhs,
+// 		     const oln::abstract::point<P>& rhs)
+//     {
+//       return lhs.operator==(rhs); // FIXME: rename 'point::operator==' into 'point::eq'
+//     }
+
+//   } // end of namespace oln::internal
+
+
 } // end of namespace oln
 
 
Index: oln/core/abstract/size.hh
===================================================================
--- oln/core/abstract/size.hh	(revision 259)
+++ oln/core/abstract/size.hh	(working copy)
@@ -90,6 +90,20 @@
 
   } // end of namespace abstract
 
+//   // FIXME: this op is better than the corresponding collection of
+//   // op for subclasses
+//   namespace internal
+//   {
+
+//     template <typename S>
+//     bool operator_eq(const oln::abstract::size<S>& lhs,
+// 		     const oln::abstract::size<S>& rhs)
+//     {
+//       return lhs.operator==(rhs);
+//     }
+
+//   } // end of namespace oln::internal
+
 } // end of namespace oln
 
 
Index: oln/core/coord.hh
===================================================================
--- oln/core/coord.hh	(revision 259)
+++ oln/core/coord.hh	(working copy)
@@ -33,7 +33,7 @@
 # include <mlc/contract.hh>
 
 
-// FIXME: doc
+// FIXME: this file should be in oln/utils/
 
 
 namespace oln {
@@ -69,22 +69,6 @@
       return value_;
     }
 
-    bool operator==(value_type rhs) const
-    {
-      if (! this->is_defined())
-	{
-	  std::cerr << "oops" << std::endl;
-	}
-      precondition(this->is_defined());
-      return value_ == rhs;
-    }
-
-    bool operator!=(value_type rhs) const
-    {
-      precondition(this->is_defined());
-      return value_ != rhs;
-    }
-
     const coord_t operator+(value_type rhs) const
     {
       precondition(this->is_defined());
@@ -170,6 +154,24 @@
   };
 
 
+  namespace internal
+  {
+
+    bool operator_eq(const coord_t& lhs, const coord_t& rhs)
+    {
+      precondition(lhs.is_defined() and rhs.is_defined());
+      return coord_t::value_type(lhs) == coord_t::value_type(rhs);
+    }
+
+    bool operator_less(const coord_t& lhs, const coord_t& rhs)
+    {
+      precondition(lhs.is_defined() and rhs.is_defined());
+      return coord_t::value_type(lhs) < coord_t::value_type(rhs);
+    }
+
+  } // end of namespace oln::internal
+
+
 } // end of namespace oln
 
 
Index: oln/core/2d/dpoint2d.hh
===================================================================
--- oln/core/2d/dpoint2d.hh	(revision 259)
+++ oln/core/2d/dpoint2d.hh	(working copy)
@@ -76,12 +76,6 @@
       return *this;
     }
 
-    const dpoint2d operator+(const dpoint2d& rhs) const
-    {
-      dpoint2d tmp(this->row() + rhs.row(), this->col() + rhs.col());
-      return tmp;
-    }
-
     const point2d operator+(const point2d& rhs) const;
 
     const dpoint2d operator-() const
@@ -156,7 +150,23 @@
     return tmp;
   }
 
-}
+  namespace internal
+  {
 
+    const dpoint2d operator_plus(const dpoint2d& lhs, const dpoint2d& rhs)
+    {
+      dpoint2d tmp(lhs.row() + rhs.row(), lhs.col() + rhs.col());
+      return tmp;
+    }
 
+    bool operator_eq(const dpoint2d& lhs, const dpoint2d& rhs)
+    {
+      return lhs.row() == rhs.row() and lhs.col() == rhs.col();
+    }
+    
+  } // end of namespace oln::internal
+
+} // end of namespace oln
+
+
 #endif // ! OLENA_CORE_2D_DPOINT2D_HH
Index: oln/core/2d/point2d.hh
===================================================================
--- oln/core/2d/point2d.hh	(revision 259)
+++ oln/core/2d/point2d.hh	(working copy)
@@ -158,6 +158,16 @@
     return tmp;
   }
 
+  namespace internal
+  {
+
+    bool operator_eq(const point2d& lhs, const point2d& rhs)
+    {
+      return lhs.operator==(rhs); // FIXME: should be lhs.eq(rhs)
+    }
+
+  } // end of namespace oln::internal
+
 } // end of namespace oln
 
 
Index: oln/core/2d/size2d.hh
===================================================================
--- oln/core/2d/size2d.hh	(revision 259)
+++ oln/core/2d/size2d.hh	(working copy)
@@ -106,6 +106,17 @@
   };
 
 
+  namespace internal
+  {
+
+    bool operator_eq(const size2d& lhs, const size2d& rhs)
+    {
+      return lhs.operator==(rhs);
+    }
+
+  } // end of namespace oln::internal
+
+
 } // end of namespace oln
 
 
Index: oln/core/pw/macros.hh
===================================================================
--- oln/core/pw/macros.hh	(revision 259)
+++ oln/core/pw/macros.hh	(working copy)
@@ -28,112 +28,45 @@
 #ifndef OLENA_CORE_PW_MACROS_HH
 # define OLENA_CORE_PW_MACROS_HH
 
-# include <oln/core/pw/unary_op.hh>
+# include <oln/utils/overload.hh>
 # include <oln/core/pw/binary_op.hh>
 # include <oln/core/pw/literal.hh>
 
 
-# define oln_pw_decl_binary(OperatorName, OperatorSymbol)		\
-									\
-template <typename L, typename R>					\
-const oln::pw::binary_op< oln::f_##OperatorName##_type,			\
-                           L, R >					\
-operator OperatorSymbol (const oln::pw::abstract::function<L>& lhs,	\
-			 const oln::pw::abstract::function<R>& rhs)	\
-{									\
-  precondition(lhs.size() == rhs.size());				\
-  oln::pw::binary_op< oln::f_##OperatorName##_type,			\
-                       L, R > tmp(lhs, rhs);				\
-  return tmp;								\
-}									\
-									\
-struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
 
-
-
-
-
-
-# define oln_pw_decl_binary_with_lit(OperatorName, OperatorSymbol, LiteralType)	\
-										\
-template <typename L>								\
-const oln::pw::binary_op< oln::f_##OperatorName##_type,				\
-			   L, oln::pw::literal<LiteralType> >			\
-operator OperatorSymbol (const oln::pw::abstract::function<L>& lhs,		\
-			 const LiteralType& rhs)				\
-{										\
-  oln::pw::literal<LiteralType> rhs_(rhs);					\
-  oln::pw::binary_op< oln::f_##OperatorName##_type,				\
-                      L, oln::pw::literal<LiteralType> > tmp(lhs, rhs_);	\
-  return tmp;									\
-}										\
-										\
-template <typename R>								\
-const oln::pw::binary_op< oln::f_##OperatorName##_type,				\
-			   oln::pw::literal<LiteralType>, R >			\
-operator OperatorSymbol (const LiteralType& lhs,				\
-			 const oln::pw::abstract::function<R>& rhs)		\
-{										\
-  oln::pw::literal<LiteralType> lhs_(lhs);					\
-  oln::pw::binary_op< oln::f_##OperatorName##_type,				\
-                      oln::pw::literal<LiteralType>, R > tmp(lhs_, rhs);	\
-  return tmp;									\
-}										\
-										\
+# define oln_pw_decl_binary(OperatorName)			\
+								\
+  template <typename F1, typename F2>				\
+  struct set_overload_2 < tag::op_##OperatorName,		\
+			  where<F1, pw::abstract::function>,	\
+			  where<F2, pw::abstract::function> >	\
+  {								\
+    typedef pw::binary_op< f_##OperatorName##_type,		\
+			   F1, F2> ret;				\
+    static ret exec(const F1& lhs, const F2& rhs)		\
+    {								\
+      ret tmp(lhs, rhs);					\
+      return tmp;						\
+    }								\
+  };								\
+								\
+  template <typename F, typename T>				\
+  struct set_overload_2 < tag::op_##OperatorName,		\
+			  where<F, pw::abstract::function>,	\
+			  where<T, whatever> >			\
+  {								\
+    typedef pw::literal<T> rhs_type;				\
+    typedef pw::binary_op< oln::f_##OperatorName##_type,	\
+			   F, rhs_type> ret;			\
+    static ret exec(const F& lhs, const T& rhs)			\
+    {								\
+      rhs_type rhs_(rhs);					\
+      ret tmp(lhs, rhs_);					\
+      return tmp;						\
+    }								\
+  };								\
+								\
 struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
 
 
-
-
-/// Explicit versions of macros.
-
-
-# define oln_pw_decl_binary_explicit(OperatorName, OperatorSymbol)	\
-									\
-template <typename L, typename R>					\
-const oln::pw::binary_op< oln::f_##OperatorName##_type,			\
-                           L, R >					\
-OperatorName (const oln::pw::abstract::function<L>& lhs,		\
-	      const oln::pw::abstract::function<R>& rhs)		\
-{									\
-  precondition(lhs.size() == rhs.size());				\
-  oln::pw::binary_op< oln::f_##OperatorName##_type,			\
-                       L, R > tmp(lhs, rhs);				\
-  return tmp;								\
-}									\
-									\
-struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
-
-
-
-# define oln_pw_decl_binary_with_lit_explicit(OperatorName, OperatorSymbol, LiteralType)	\
-												\
-template <typename L>										\
-const oln::pw::binary_op< oln::f_##OperatorName##_type,						\
-			   L, oln::pw::literal<LiteralType> >					\
-OperatorName (const oln::pw::abstract::function<L>& lhs,					\
-	      const LiteralType& rhs)								\
-{												\
-  oln::pw::literal<LiteralType> rhs_(rhs);							\
-  oln::pw::binary_op< oln::f_##OperatorName##_type,						\
-                      L, oln::pw::literal<LiteralType> > tmp(lhs, rhs_);			\
-  return tmp;											\
-}												\
-												\
-template <typename R>										\
-const oln::pw::binary_op< oln::f_##OperatorName##_type,						\
-			   oln::pw::literal<LiteralType>, R >					\
-OperatorName (const LiteralType& lhs,								\
-	      const oln::pw::abstract::function<R>& rhs)					\
-{												\
-  oln::pw::literal<LiteralType> lhs_(lhs);							\
-  oln::pw::binary_op< oln::f_##OperatorName##_type,						\
-                      oln::pw::literal<LiteralType>, R > tmp(lhs_, rhs);			\
-  return tmp;											\
-}												\
-												\
-struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
-
-
-
 #endif // ! OLENA_CORE_PW_MACROS_HH
Index: oln/core/pw/arith.hh
===================================================================
--- oln/core/pw/arith.hh	(revision 259)
+++ oln/core/pw/arith.hh	(working copy)
@@ -36,6 +36,13 @@
 namespace oln
 {
 
+  oln_pw_decl_binary(plus);
+  oln_pw_decl_binary(minus);
+  oln_pw_decl_binary(times);
+  oln_pw_decl_binary(div);
+  oln_pw_decl_binary(mod);
+
+
   // min max
 
   template <typename L, typename R>
@@ -77,31 +84,6 @@
   }
 
 
-oln_pw_decl_binary(  plus, + );
-oln_pw_decl_binary( minus, - );
-oln_pw_decl_binary( times, * );
-oln_pw_decl_binary(   div, / );
-oln_pw_decl_binary(   mod, % );
-
-// FIXME: uminus?
-
-
-# define oln_pw_decl_arith_lit(LiteralType)		\
-							\
-oln_pw_decl_binary_with_lit(  plus, +, LiteralType);	\
-oln_pw_decl_binary_with_lit( minus, -, LiteralType);	\
-oln_pw_decl_binary_with_lit( times, +, LiteralType);	\
-oln_pw_decl_binary_with_lit(   div, /, LiteralType);	\
-oln_pw_decl_binary_with_lit(   mod, %, LiteralType);	\
-							\
-struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
-
-
-oln_pw_decl_arith_lit(int);
-oln_pw_decl_arith_lit(float);
-oln_pw_decl_arith_lit(double);
-
-
 } // end of namespace oln
 
 
Index: oln/core/pw/logic.hh
===================================================================
--- oln/core/pw/logic.hh	(revision 259)
+++ oln/core/pw/logic.hh	(working copy)
@@ -32,42 +32,6 @@
 # include <oln/core/pw/macros.hh>
 
 
-oln_pw_decl_binary(and, and);
-oln_pw_decl_binary(or,  or);
-oln_pw_decl_binary(xor, xor);
 
-// FIXME: not?
 
-
-# define oln_pw_decl_logic_lit(LiteralType)		\
-							\
-oln_pw_decl_binary_with_lit(and, and, LiteralType);	\
-oln_pw_decl_binary_with_lit(or,  or,  LiteralType);	\
-oln_pw_decl_binary_with_lit(xor, xor, LiteralType);	\
-							\
-struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
-
-
-
-namespace ntg {
-  struct bin;
-}
-
-oln_pw_decl_logic_lit(bool);
-oln_pw_decl_logic_lit(ntg::bin);
-
-
-
-
-//       template <typename E>
-//       not_<E>
-//       function<E>::operator!() const
-//       {
-// 	mlc::eq< oln_typeness_of(oln_pw_type_of(E, value)), typeness::binary_tag >::ensure();
-// 	not_<E> tmp(this->exact());
-// 	return tmp;
-//       }
-
-
-
 #endif // ! OLENA_CORE_PW_LOGIC_HH
Index: oln/core/pw/cmp.hh
===================================================================
--- oln/core/pw/cmp.hh	(revision 259)
+++ oln/core/pw/cmp.hh	(working copy)
@@ -34,53 +34,16 @@
 
 namespace oln {
 
-  namespace pw {
+  oln_pw_decl_binary(eq);
+  oln_pw_decl_binary(neq);
+  oln_pw_decl_binary(less);
+  oln_pw_decl_binary(leq);
+  oln_pw_decl_binary(greater);
+  oln_pw_decl_binary(geq);
 
-//     oln_pw_decl_binary_explicit(      eq, == );
-//     oln_pw_decl_binary_explicit(     neq, != );
-//     oln_pw_decl_binary_explicit(    less, <  );
-// //     oln_pw_decl_binary_explicit(     leq, <= );
-//     oln_pw_decl_binary_explicit( greater, >  );
-//     oln_pw_decl_binary_explicit(     geq, >= );
-
-    oln_pw_decl_binary(      eq, == );
-    oln_pw_decl_binary(     neq, != );
-    oln_pw_decl_binary(    less, <  );
-    oln_pw_decl_binary(     leq, <= );
-    oln_pw_decl_binary( greater, >  );
-    oln_pw_decl_binary(     geq, >= );
-
-  } // end of namespace oln::pw
-
 } // end of namespace oln
 
 
-# define oln_pw_decl_cmp_lit(LiteralType)		\
-							\
-oln_pw_decl_binary_with_lit(      eq, ==, LiteralType);	\
-oln_pw_decl_binary_with_lit(     neq, !=, LiteralType);	\
-oln_pw_decl_binary_with_lit(     leq, <=, LiteralType); \
-oln_pw_decl_binary_with_lit(    less, < , LiteralType);	\
-oln_pw_decl_binary_with_lit( greater, > , LiteralType);	\
-oln_pw_decl_binary_with_lit(     geq, >=, LiteralType);	\
-							\
-struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
 
 
-
-
-namespace oln {
-
-  namespace pw {
-
-    oln_pw_decl_cmp_lit(int);
-    oln_pw_decl_cmp_lit(float);
-    oln_pw_decl_cmp_lit(double);
-
-  } // end of namespace oln::pw
-
-} // end of namespace oln
-
-
-
 #endif // ! OLENA_CORE_PW_CMP_HH
Index: oln/core/gen/regular_window.hh
===================================================================
--- oln/core/gen/regular_window.hh	(revision 259)
+++ oln/core/gen/regular_window.hh	(working copy)
@@ -136,8 +136,7 @@
       E get_fwd_win() const
       {
 	E out;
-
-	for (unsigned i = 0; i < this->dp_.size(); ++i)
+	for (unsigned i = 0; i < this->card(); ++i)
 	  {
 	    const dpoint_type& dp = dp_[i];
 
@@ -157,9 +156,7 @@
       E get_fwd_win_p() const // abstract::window<W>& win)
       {
 	E out;
-
-
-	for (unsigned i = 0; i < this->dp_.size(); ++i)
+	for (unsigned i = 0; i < this->card(); ++i)
 	  {
 	    const dpoint_type& dp = dp_[i];
 
@@ -185,8 +182,7 @@
       E get_bkd_win() const
       {
 	E out;
-
-	for (unsigned i = 0; i < this->dp_.size(); ++i)
+	for (unsigned i = 0; i < this->card(); ++i)
 	  {
 	    const dpoint_type& dp = dp_[i];
 
@@ -206,8 +202,7 @@
       E get_bkd_win_p() const
       {
 	E out;
-
-	for (unsigned i = 0; i < this->dp_.size(); ++i)
+	for (unsigned i = 0; i < this->card(); ++i)
 	  {
 	    const dpoint_type& dp = get_dp()[i];
 
Index: oln/utils/buffer.hxx
===================================================================
--- oln/utils/buffer.hxx	(revision 259)
+++ oln/utils/buffer.hxx	(working copy)
@@ -46,7 +46,7 @@
 inline
 void buffer::add(const E &e, bool count)
 {
-  ntg_storage_type(E)	mask = 1 << (ntg_nbits(E) - 1);
+  ntg_storage_type(E)	mask = 1 << (sizeof(unsigned)*8/*ntg_nbits(E)*/ - 1);
   ntg_storage_type(E) e_cast = e;
 
   while (mask)
@@ -104,7 +104,7 @@
 
 // [] operator implementation
 inline
-ntg::int_u32 buffer::operator[] (unsigned n) const
+unsigned/*ntg::int_u32*/ buffer::operator[] (unsigned n) const
 {
   precondition(n < data_.size());
 
Index: oln/utils/buffer.hh
===================================================================
--- oln/utils/buffer.hh	(revision 259)
+++ oln/utils/buffer.hh	(working copy)
@@ -40,7 +40,7 @@
     class buffer
     {
     public:
-      typedef ntg::int_u32		value_type; ///< Used data type.
+      typedef unsigned/*ntg::int_u32*/		value_type; ///< Used data type.
 
       /*!
       ** \brief Initialization of data.
@@ -70,7 +70,7 @@
       /*!
       ** \brief Return the nth word.
       */
-      ntg::int_u32 operator[] (unsigned n) const;
+      unsigned/*ntg::int_u32*/ operator[] (unsigned n) const;
 
       /*!
       ** \brief Append padding bits.
Index: oln/utils/overload.hh
===================================================================
--- oln/utils/overload.hh	(revision 259)
+++ oln/utils/overload.hh	(working copy)
@@ -35,7 +35,13 @@
 
 
 
+// FIXME: most code here should move to metalic!
 
+// FIXME: some piece of code should move to oln/core?
+
+
+
+
 //   // Sample use:
 
 //   struct for_doit;
@@ -75,24 +81,37 @@
 
 // fwd decls
 
-
 namespace ntg
 {
   template <typename E> struct value;
 
 } // end of namespace ntg
 
-
 namespace oln
 {
-  template <typename I> struct value_box;
 
+  namespace internal
+  {
+    template <typename I> struct value_box;
+
+  } // end of namespace oln::internal
+
   namespace abstract
   {
     template <typename I> struct image;
 
   } // end of namespace oln::abstract
 
+  namespace pw
+  {
+    namespace abstract
+    {
+      template <typename F> struct function;
+
+    } // end of namespace oln::pw::abstract
+
+  } // end of namespace oln::pw
+
 } // end of namespace oln
 
 
@@ -101,6 +120,7 @@
 
 
 
+
 namespace oln
 {
 
@@ -126,14 +146,35 @@
     typedef mlc::undefined_type ret;
   };
 
-  template <typename what_is_overloaded, typename where_clause_1, typename where_clause_2>
+  template <typename what_is_overloaded,
+	    typename where_clause_1, typename where_clause_2>
   struct set_overload_2
   {
     typedef mlc::undefined_type ret;
   };
 
 
+  /// Make 'whatever' be the 'default' overload.
 
+  template <typename W, typename T1, typename T2>
+  struct set_overload_2 < W, where<T1,whatever>, where<T2,whatever> >
+  {
+    typedef mlc::undefined_type ret;
+  };
+
+  template <typename W,
+	    typename T1, template <class> class A1,
+	    typename T2, template <class> class A2>
+  struct set_overload_2     < W, where<T1,A1>,       where<T2,A2>       >
+    : public set_overload_2 < W, where<T1,whatever>, where<T2,whatever> >
+  {
+    typedef set_overload_2<W, where<T1,whatever>, where<T2,whatever> > super_type;
+    using super_type::ret;
+    using super_type::exec;
+  };
+
+
+
   namespace internal {
 
 
@@ -145,17 +186,19 @@
       typedef typename
       mlc::if_< mlc_is_a(T, ntg::value),
 		where<T, ntg::value>, typename 
-		mlc::if_< mlc_is_a(T, abstract::image),
-			  where<T, abstract::image>, typename 
-			  mlc::if_< mlc_is_a(T, value_box),
-				    where<T, value_box>,
-				    where<T>
+		mlc::if_< mlc_is_a(T, oln::abstract::image),
+			  where<T, oln::abstract::image>, typename 
+			  mlc::if_< mlc_is_a(T, oln::internal::value_box),
+				    where<T, oln::internal::value_box>, typename 
+				    mlc::if_< mlc_is_a(T, oln::pw::abstract::function),
+					      where<T, oln::pw::abstract::function>,
+					      where<T>
+                                             >::ret
                                    >::ret
                          >::ret
               >::ret
       ret;
-    // FIXME: to be continued...
-  };
+    };
 
 
 
@@ -197,4 +240,190 @@
 } // end of namespace oln
 
 
+
+
+# include <ntg/core/internal/global_ops.hh>
+
+
+
+# define oln_decl_binary_op(OperatorName, OperatorSymbol)		\
+									\
+  template <typename T1, typename T2>					\
+  struct set_overload_2 < tag::op_##OperatorName,			\
+			  where<T1, whatever>,				\
+			  where<T2, whatever> >				\
+  {									\
+    typedef bool ret;							\
+    static ret exec(const T1& lhs, const T2& rhs)			\
+    {									\
+      return oln::internal::operator_##OperatorName(lhs, rhs);		\
+    }									\
+  };									\
+									\
+  template <typename T1, typename T2>					\
+  struct set_overload_2 < tag::op_##OperatorName,			\
+			  where<T1, ntg::value>,			\
+			  where<T2, whatever> >				\
+  {									\
+    typedef bool ret;							\
+    static ret exec(const T1& lhs, const T2& rhs)			\
+    {									\
+      return ntg::internal::operator OperatorSymbol (lhs, rhs);		\
+    }									\
+  };									\
+									\
+  template <typename T1, typename T2>					\
+  struct set_overload_2 < tag::op_##OperatorName,			\
+			  where<T1, whatever>,				\
+			  where<T2, ntg::value> >			\
+  {									\
+    typedef bool ret;							\
+    static ret exec(const T1& lhs, const T2& rhs)			\
+    {									\
+      return ntg::internal::operator OperatorSymbol (lhs, rhs);		\
+    }									\
+  };									\
+									\
+  template <typename T1, typename T2>					\
+  struct set_overload_2 < tag::op_##OperatorName,			\
+			  where<T1, ntg::value>,			\
+			  where<T2, ntg::value> >			\
+  {									\
+    typedef bool ret;							\
+    static ret exec(const T1& lhs, const T2& rhs)			\
+    {									\
+      return ntg::internal::operator OperatorSymbol (lhs, rhs);		\
+    }									\
+  };									\
+									\
+  template <typename T1, typename T2>					\
+  typename overload_2<tag::op_##OperatorName, T1, T2>::ret		\
+  operator OperatorSymbol (const T1& lhs, const T2& rhs)		\
+  {									\
+    return overload_2<tag::op_##OperatorName, T1, T2>::exec(lhs, rhs);	\
+  }									\
+									\
+struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
+
+
+
+
+namespace oln
+{
+
+  /// Tags for operators.
+
+  namespace tag
+  {
+
+    // Cmp tags.
+
+    struct op_eq;
+    struct op_neq;
+    struct op_less;
+    struct op_leq;
+    struct op_greater;
+    struct op_geq;
+
+    // Logic tags.
+
+    struct op_not;
+    struct op_and;
+    struct op_nand;
+    struct op_or;
+    struct op_nor;
+    struct op_xor;
+    struct op_xnor;
+
+    // Arith tags.
+
+    struct op_plus;
+    struct op_minus;
+    struct op_uminus;
+    struct op_times;
+    struct op_div;
+    struct op_mod;
+  
+  } // end of namespace tag
+
+
+
+  // Cmp operators.
+
+
+  namespace internal
+  {
+
+    // Empty fwd decl for canonical cmp operators:
+    // operator_eq and operator_less.
+    // Both operands should exactly have the same type (T).
+
+    template <typename T>
+    bool operator_eq(const T&, const T&);
+
+    template <typename T>
+    bool operator_less(const T&, const T&);
+
+
+    // Default impl for oln::internal::operator_*'s.
+
+    // Warning: an important assumption of default impls is that
+    // the return type is bool.
+
+    // FIXME: should they call operator_* or the facade?
+    // e.g., should we replace "not operator_eq(lhs, rhs)" by
+    // "not (lhs == rhs)"?
+
+    template <typename T1, typename T2>
+    bool operator_neq(const T1& lhs, const T2& rhs)
+    {
+      // "lhs != rhs"  is  "not (lhs == rhs)"
+      return not oln::internal::operator_eq(lhs, rhs);
+    }
+
+    template <typename T1, typename T2>
+    bool operator_leq(const T1& lhs, const T2& rhs)
+    {
+      // "lhs <= rhs"  is  "not (rhs < lhs)"
+      return not oln::internal::operator_less(rhs, lhs);
+    }
+
+    template <typename T1, typename T2>
+    bool operator_greater(const T1& lhs, const T2& rhs)
+    {
+      // "lhs > rhs"  is  "rhs < lhs"
+      return oln::internal::operator_less(rhs, lhs);
+    }
+
+    template <typename T1, typename T2>
+    bool operator_geq(const T1& lhs, const T2& rhs)
+    {
+      // "lhs >= rhs"  is  "not (lhs < rhs)"
+      return not oln::internal::operator_less(lhs, rhs);
+    }
+
+  } // end of namespace oln::internal
+
+
+
+  // Section dedicated to ntg types
+  // ------------------------------
+  // When such a type is involved in an "oln::operator something(lhs, rhs)"
+  // call, the default behavior is to turn to ntg to solve this call.
+  // One could think that since we presently *are* in oln, FIXME
+  // 
+
+
+  oln_decl_binary_op(      eq, == );
+  oln_decl_binary_op(     neq, != );
+  oln_decl_binary_op(    less, <  );
+  oln_decl_binary_op(     leq, <= );
+  oln_decl_binary_op( greater, >  );
+  oln_decl_binary_op(     geq, >= );
+
+
+
+} // end of namespace oln
+
+
 #endif // ! OLN_UTILS_OVERLOAD_HH
Index: oln/ops/macro.hh
===================================================================
--- oln/ops/macro.hh	(revision 0)
+++ oln/ops/macro.hh	(revision 0)
@@ -0,0 +1,53 @@
+// 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 OLENA_OPS_MACRO_HH
+# define OLENA_OPS_MACRO_HH
+
+# include <oln/core/abstract/image.hh>
+# include <oln/core/pw/value.hh>
+# include <oln/core/pw/check.hh>
+
+
+# define oln_decl_image_binary_op(OperatorName)				\
+									\
+  template <typename F1, typename F2>					\
+  struct set_overload_2 < tag::op_##OperatorName,			\
+			  where<F1, oln::abstract::image>,		\
+			  where<F2, oln::abstract::image> >		\
+  {									\
+    typedef bool ret;							\
+    static ret exec(const F1& lhs, const F2& rhs)			\
+    {									\
+      return oln::pw::check(oln::pw_value(lhs) == oln::pw_value(rhs));	\
+    }									\
+  };									\
+									\
+struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
+
+
+#endif // ! OLENA_OPS_MACRO_HH
Index: oln/ops/cmp.hh
===================================================================
--- oln/ops/cmp.hh	(revision 259)
+++ oln/ops/cmp.hh	(working copy)
@@ -28,74 +28,20 @@
 #ifndef OLENA_OPS_CMP_HH
 # define OLENA_OPS_CMP_HH
 
-# include <oln/core/abstract/image.hh>
+# include <oln/ops/macro.hh>
 # include <oln/core/pw/cmp.hh>
-# include <oln/core/pw/check.hh>
 
 
+
 namespace oln {
 
+  oln_decl_image_binary_op(eq);
+  oln_decl_image_binary_op(neq);
+  oln_decl_image_binary_op(less);
+  oln_decl_image_binary_op(leq);
+  oln_decl_image_binary_op(greater);
+  oln_decl_image_binary_op(geq);
 
-  /// Operator '==' between 2 images.
-
-  template <typename L, typename R>
-  bool operator == (const oln::abstract::image<L>& lhs,
-		    const oln::abstract::image<R>& rhs)
-  {
-    return oln::pw::check(oln::pw_value(lhs) == oln::pw_value(rhs));
-  }
-
-
-  /// Operator '!=' between 2 images.
-
-  template <typename L, typename R>
-  bool operator != (const oln::abstract::image<L>& lhs,
-		    const oln::abstract::image<R>& rhs)
-  {
-    return oln::pw::check(oln::pw_value(lhs) != oln::pw_value(rhs));
-  }
-
-
-  /// Operator '<'  between 2 images.
-
-  template <typename L, typename R>
-  bool operator <  (const oln::abstract::image<L>& lhs,
-		    const oln::abstract::image<R>& rhs)
-  {
-    return oln::pw::check(oln::pw_value(lhs) <  oln::pw_value(rhs));
-  }
-
-
-  /// Operator '<=' between 2 images.
-
-  template <typename L, typename R>
-  bool operator <= (const oln::abstract::image<L>& lhs,
-		    const oln::abstract::image<R>& rhs)
-  {
-    return oln::pw::check(oln::pw_value(lhs) <= oln::pw_value(rhs));
-  }
-
-
-  /// Operator '>'  between 2 images.
-
-  template <typename L, typename R>
-  bool operator >  (const oln::abstract::image<L>& lhs,
-		    const oln::abstract::image<R>& rhs)
-  {
-    return oln::pw::check(oln::pw_value(lhs) >  oln::pw_value(rhs));
-  }
-
-
-  /// Operator '>=' between 2 images.
-
-  template <typename L, typename R>
-  bool operator >= (const oln::abstract::image<L>& lhs,
-		    const oln::abstract::image<R>& rhs)
-  {
-    return oln::pw::check(oln::pw_value(lhs) >= oln::pw_value(rhs));
-  }
-
-
 } // end of namespace oln
 
 
Index: oln/makefile.src
===================================================================
--- oln/makefile.src	(revision 259)
+++ oln/makefile.src	(working copy)
@@ -154,8 +154,16 @@
   funobj/logic.hh				\
 						\
   io/gz_stream.hh				\
+  io/pnm_bin.hh					\
+  io/pnm_header.hh				\
+  io/pnm_read.hh				\
+  io/pnm_real.hh				\
+  io/pnm_vect.hh				\
+  io/pnm_write.hh				\
   io/read_image.hh				\
+  io/scalar.hh					\
   io/utils.hh					\
+  io/vectorial.hh				\
   io/write_image.hh				\
 						\
   level/arith.hh				\
@@ -191,6 +199,7 @@
   ops/arith.hh					\
   ops/cmp.hh					\
   ops/logic.hh					\
+  ops/macro.hh					\
 						\
   utils/buffer.hh				\
   utils/clone.hh				\
Index: oln/morpho/lower_completion.hh
===================================================================
--- oln/morpho/lower_completion.hh	(revision 259)
+++ oln/morpho/lower_completion.hh	(working copy)
@@ -30,7 +30,8 @@
 
 # include <queue>
 
-# include "oln/level/fill.hh"
+# include <oln/basics.hh>
+# include <oln/level/fill.hh>
 
 namespace oln {
 
Index: oln/appli/astro/graphical_interface/utils.hh
===================================================================
--- oln/appli/astro/graphical_interface/utils.hh	(revision 259)
+++ oln/appli/astro/graphical_interface/utils.hh	(working copy)
@@ -28,19 +28,21 @@
 #ifndef _UTILS_HH_
 # define _UTILS_HH_
 
+// FIXME: #include something here!
+
 namespace Utils {
   std::string int2string(int inum)
   {
-    using namespace std;
-    ostringstream oss;
+    //using namespace std;
+    std::ostringstream oss;
     oss << inum;
-    string snum(oss.str());
+    std::string snum(oss.str());
     return snum;
   }
   int string2int(std::string snum)
   {
-    using namespace std;
-    istringstream iss(snum);
+    //using namespace std;
+    std::istringstream iss(snum);
     int inum;
     iss >> inum;
     return inum;
Index: oln/io/pnm_bin.hh
===================================================================
--- oln/io/pnm_bin.hh	(revision 259)
+++ oln/io/pnm_bin.hh	(working copy)
@@ -30,9 +30,9 @@
 
 # include <iostream>
 
+# include <oln/basics2d.hh>
 # include <oln/canvas/io.hh>
 # include <oln/io/pnm_header.hh>
-# include <oln/core/2d/grid2d.hh>
 # include <oln/core/2d/point2d.hh>
 # include <oln/core/2d/size2d.hh>
 
Index: oln/level/arith.hh
===================================================================
--- oln/level/arith.hh	(revision 259)
+++ oln/level/arith.hh	(working copy)
@@ -29,6 +29,7 @@
 # define OLENA_LEVEL_ARITH_HH
 
 # include <mlc/cmp.hh>
+# include <oln/core/abstract/size.hh>
 # include <oln/core/ch_value_type.hh>
 
 # include <oln/funobj/arith.hh>
