From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE autolearn=disabled version=3.1.3 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 14EC5BC69 for ; Sun, 4 Nov 2007 08:29:43 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKMRLUfUGyojimdsb2JhbACBW40WAgEIAggREQc X-IronPort-AV: E=Sophos;i="4.21,368,1188770400"; d="scan'208";a="4015932" Received: from smtp5-g19.free.fr ([212.27.42.35]) by mail1-smtp-roc.national.inria.fr with ESMTP; 04 Nov 2007 08:29:43 +0100 Received: from smtp5-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp5-g19.free.fr (Postfix) with ESMTP id 9C6C73F6168; Sun, 4 Nov 2007 08:29:42 +0100 (CET) Received: from Llea.celt.neu (ron34-3-82-236-236-194.fbx.proxad.net [82.236.236.194]) by smtp5-g19.free.fr (Postfix) with ESMTP id 784A23F6167; Sun, 4 Nov 2007 08:29:42 +0100 (CET) Received: from Llea.celt.neu (localhost [127.0.0.1]) by Llea.celt.neu (8.14.1/8.13.8) with ESMTP id lA47YPjF001220; Sun, 4 Nov 2007 08:34:25 +0100 (CET) (envelope-from michael.le_barbier@laposte.net) Received: (from michael@localhost) by Llea.celt.neu (8.14.1/8.13.8/Submit) id lA47YPIO001219; Sun, 4 Nov 2007 08:34:25 +0100 (CET) (envelope-from michael.le_barbier@laposte.net) X-Authentication-Warning: Llea.celt.neu: michael set sender to michael.le_barbier@laposte.net using -f To: Julien Moutinho Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Strategy to avoid name collision in signatures References: <86tzo3nf8f.fsf@Llea.celt.neu> <20071104000116.GA2256@localhost> From: michael.le_barbier@laposte.net (=?iso-8859-15?Q?Micha=EBl?= Le Barbier) Date: Sun, 04 Nov 2007 08:34:24 +0100 In-Reply-To: <20071104000116.GA2256@localhost> (Julien Moutinho's message of "Sun\, 4 Nov 2007 01\:01\:17 +0100") Message-ID: <86zlxu79bz.fsf@Llea.celt.neu> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; functor:01 struct:01 val:01 val:01 bool:01 struct:01 signatures:01 caml-list:01 int:01 int:01 writes:01 argument:02 seems:03 module:03 module:03 Julien Moutinho writes: > I'm not sure if it could be of some help, but here is another scheme > wherein the functor Type.Make does not include its argument PROTO, > so that there is no namespace conflict with type t. > However the PROTO structure can no longer be used anonymously: This is fine. Here's how I will work it out: module Ordered =3D struct module type PROTO =3D type t val compare: t -> t -> int end module type S =3D type t val compare: t -> t -> int val ge: t -> t -> bool end module Macro (P:PROTO) =3D struct let ge x y =3D (compare x y) >=3D 0 end module Make (P:PROTO) =3D struct type t =3D P.t include Macro(P) end end It seems as economic as possible, provided I want to provide both the `Macro' and `Make' version. Thanks for the hint! --=20 Cordialement, Micha=EBl LB