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 LAA10622; Wed, 14 Aug 2002 11:17:21 +0200 (MET DST) 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 LAA10430 for ; Wed, 14 Aug 2002 11:17:20 +0200 (MET DST) Received: from colt.epita.fr (colt.epita.fr [62.23.180.27]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g7E9HJn15391 for ; Wed, 14 Aug 2002 11:17:19 +0200 (MET DST) Received: from hermes.epita.fr (hermes.epita.fr [163.5.255.10]) by colt.epita.fr id g7E9L9E18460 Wed, 14 Aug 2002 11:21:09 +0200 (MEST) Received: from goa.lrde.epita.fr (mail@goa.lrde.epita.fr [10.223.13.2]) by hermes.epita.fr id g7E9LAe27089 Wed, 14 Aug 2002 11:21:10 +0200 (MEST) Received: from barcelona.lrde.epita.fr ([10.223.13.32] ident=mail) by goa.lrde.epita.fr with esmtp (Exim 3.35 #1 (Debian)) id 17euL2-0004os-00; Wed, 14 Aug 2002 11:21:12 +0200 Received: from yann by barcelona.lrde.epita.fr with local (Exim 3.33 #1 (Debian)) id 17euWx-0003WT-00; Wed, 14 Aug 2002 11:33:31 +0200 Date: Wed, 14 Aug 2002 11:33:29 +0200 To: Johan =?iso-8859-1?Q?Balti=C3=A9?= Cc: caml-list@inria.fr Subject: Re: [Caml-list] Module/Functor modelisation Message-ID: <20020814093329.GE6002@barcelona.lrde.epita.fr> Reply-To: yann@lrde.epita.fr References: <20020814070753.M11217@wanadoo.fr> <20020814074250.GA6002@barcelona.lrde.epita.fr> <20020814074844.M48926@epita.fr> <20020814074950.M92721@wanadoo.fr> <20020814083553.GC6002@barcelona.lrde.epita.fr> <20020814083157.M89732@wanadoo.fr> <20020814090548.GD6002@barcelona.lrde.epita.fr> <20020814085806.M98813@wanadoo.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20020814085806.M98813@wanadoo.fr> User-Agent: Mutt/1.3.25i From: =?iso-8859-1?Q?Yann_R=E9gis-Gianas?= Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Aug 14, 2002 at 09:58:06AM +0100, Johan Baltié wrote: > Mon probleme tient effectivement dans l'utilisation d'un autre functor. > > Appellons le GenericTraverse: > > module GenericTraverse = > functor (T : Traverse) -> > functor (Av: Visitor) -> > struct > ..... > let pattern_action p data = > match p with > | PatternAction(pat, act) -> > T.action act (T.pattern pat data) > | PatternActionList(pa1, pa2) -> > T.pattern_action pa2 (T.pattern_action pa1 data) > .... > end > > > Le probleme est maintenant comment l'utiliser ??? > > module PostfixTraverse = ???? > struct > > let pattern_action p data = > let output = Av.pattern_action p data > in > GenericTraverse.pattern_action p output > end > Ce que tu es en train de faire, ca s'appelle des modules mixins et malheuresement Objective Caml ne le gère pas pour le moment. Par contre, est-ce que tu ne voudrais pas faire un truc du style: module type TraverseWithoutPatternAction = sig (* ce qui ne dépend pas de pattern_action *) end module PostfixTraverse (T : TraverseWithoutPatternAction) (Av: Visitor) = struct let pattern_action p data = (* ... *) end module type TraverseType = sig val pattern_action : (* .. *) end module FinalTraverse (T : TraverseType) = struct (* ce qui dépend de pattern action *) end -- Yann Régis-Gianas. ------------------- 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