From: "Yann Régis-Gianas" <yann@lrde.epita.fr>
To: "Johan Baltié" <johan.baltie@wanadoo.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Module/Functor modelisation
Date: Wed, 14 Aug 2002 11:33:29 +0200 [thread overview]
Message-ID: <20020814093329.GE6002@barcelona.lrde.epita.fr> (raw)
In-Reply-To: <20020814085806.M98813@wanadoo.fr>
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
next prev parent reply other threads:[~2002-08-14 9:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-14 7:07 Johan Baltié
[not found] ` <20020814074250.GA6002@barcelona.lrde.epita.fr>
[not found] ` <20020814074844.M48926@epita.fr>
2002-08-14 7:49 ` Fw: " Johan Baltié
[not found] ` <20020814083553.GC6002@barcelona.lrde.epita.fr>
[not found] ` <20020814083157.M89732@wanadoo.fr>
[not found] ` <20020814090548.GD6002@barcelona.lrde.epita.fr>
[not found] ` <20020814085806.M98813@wanadoo.fr>
2002-08-14 9:33 ` Yann Régis-Gianas [this message]
[not found] ` <20020814093239.M61475@wanadoo.fr>
2002-08-14 10:00 ` Yann Régis-Gianas
-- strict thread matches above, loose matches on Subject: below --
2002-08-14 6:55 Johan Baltié
2002-08-14 7:10 ` Johan Baltié
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020814093329.GE6002@barcelona.lrde.epita.fr \
--to=yann@lrde.epita.fr \
--cc=caml-list@inria.fr \
--cc=johan.baltie@wanadoo.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox