English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Mutually recursive functions in different modules
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-09-18 (07:53)
From: Jacques Garrigue <garrigue@m...>
Subject: Re: [Caml-list] Mutually recursive functions in different modules
From: "Arthur Chan" <baguasquirrel@gmail.com>
> Is it possible to have mutually recursive functions in separate modules?
> For example, is it possible for function x in module A to call function y in
> module B and vice versa?
> The reason why I'm asking is because I've written a good bit of my code with
> functors, and now I need to make some of the code mutually recursive, and
> thus, the mutually recursive functions have to be in separate modules.

Recursive modules are available. See the "language extensions" section
of the reference manual.
(Note that this is about exactly what you asked, i.e. recursive
modules, not recursion between compilation units.)

Jacques Garrigue