From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA09802; Sun, 14 Mar 2004 20:22:40 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 UAA10260 for ; Sun, 14 Mar 2004 20:22:38 +0100 (MET) Received: from smtp.mbg.ocn.ne.jp (mbg.ocn.ne.jp [210.190.142.181]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i2EJMaHd010226 for ; Sun, 14 Mar 2004 20:22:37 +0100 Received: from localhost (p30187-adsau12honb7-acca.tokyo.ocn.ne.jp [220.99.34.187]) by smtp.mbg.ocn.ne.jp (Postfix) with ESMTP id B0B7C5661; Mon, 15 Mar 2004 04:22:34 +0900 (JST) Date: Mon, 15 Mar 2004 04:22:18 +0900 (JST) Message-Id: <20040315.042218.07646200.yoriyuki@mbg.ocn.ne.jp> To: ronniec95@lineone.net Cc: caml-list@inria.fr Subject: Re: [Caml-list] Module/functor question From: Yamagata Yoriyuki In-Reply-To: <20040314190527.GA1898@cradle> References: <20040314190527.GA1898@cradle> X-Mailer: Mew version 2.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 functor:01 yamagata:01 yoriyuki:01 yoriyuki:01 ronniec:01 lineone:01 caml-list:01 functor:01 2004:99 foo:01 foo:01 serializer:01 yamagata:01 0000:98 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 132 From: ronniec95@lineone.net Subject: [Caml-list] Module/functor question Date: Sun, 14 Mar 2004 19:05:28 +0000 > but I cannot figure out how to declare Foo having a signature of > Serialiser and then use it in main somehow. Assume also that I have > lots of other modules which have same basic interface but additional > methods specific to the modules. You do not need to declare. Foo.Make will accept any module whose signature is an *extension* of Serializer. > (* was hoping for something like this *) > let _ = let m = module Sender(Foo.Make) in > m.serialisetoxml (Foo.Make (Xml.parse_from "...")); By the way, a correct code would be let _ = let module M = Sender(Foo.Make) in M.serialisetoxml (Foo.Make (Xml.parse_from "...")); -- Yamagata Yoriyuki ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners