From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id VAA02365 for caml-red; Wed, 20 Sep 2000 21:53:05 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA00959 for ; Wed, 20 Sep 2000 15:45:11 +0200 (MET DST) Received: from isis.lip6.fr (isis.lip6.fr [132.227.60.2]) by concorde.inria.fr (8.10.0/8.10.0) with ESMTP id e8KDjBv22504 for ; Wed, 20 Sep 2000 15:45:11 +0200 (MET DST) Received: from spi.lip6.fr (IDENT:root@spi.lip6.fr [132.227.83.55]) by isis.lip6.fr (8.9.3/jtpda-5.3.2) with ESMTP id PAA03036 ; Wed, 20 Sep 2000 15:45:10 +0200 Received: from rana.lip6.fr (rana.lip6.fr [132.227.83.5]) by spi.lip6.fr (8.8.7/jtpda-5.2) with ESMTP id PAA16923 ; Wed, 20 Sep 2000 15:45:09 +0200 Received: from rana.lip6.fr (localhost [127.0.0.1]) by rana.lip6.fr (8.8.7/jtpda-5.2) with ESMTP id PAA06349 ; Wed, 20 Sep 2000 15:45:08 +0200 Message-Id: <200009201345.PAA06349@rana.lip6.fr> X-Mailer: exmh version 2.0.2 To: luther@dpt-info.u-strasbg.fr Cc: caml-list@inria.fr Subject: Re: Modules, type de modules et type polymorphes. In-Reply-To: Your message of "Tue, 19 Sep 2000 14:29:39 +0200." <20000919142939.A3312@lambda.u-strasbg.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 20 Sep 2000 15:45:07 +0200 From: "Sylvain BOULM'E" Sender: weis@pauillac.inria.fr > Bonjour, ... > Hello, ... > > quel est le probleme de ceci ? > > # module type T_A = sig > val string_of_a : 'a -> string > end;; > module type T_A = sig val string_of_a : 'a -> string end > # module A : T_A = struct > let string_of_a = string_of_int > end;; > Signature mismatch: Bonjour, Le probleme est que dans "T_A", on exige que "string_of_a" soit polymorphe. Or dans A, tu ne lui fournis qu'une fonction monomorphe !! Qq'un qui utilise un module A de type T_A a le droit d'ecrire "A.string_of_a true" Ce qui provoquerait un segmentation fault avec ton implantation de A... Je ne sais pas ceux que tu cherches a ecrire, mais qq chose comme ci-dessous serait peut-etre plus adapte : module type T_A = sig type t val string_of_a : t -> string end module A: (T_A with type t=int) = struct type t=int let string_of_a = string_of_int end Sylvain. -- Tel. prof : 01-44-27-88-35 Page web : http://www-spi.lip6.fr/~boulme/