Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Jean-Christophe Filliatre <Jean-Christophe.Filliatre@l...>
Subject: Re: [Caml-list] Mutually recursive functions in different modules

Arthur Chan writes:
 > Hey all,
 > 
 > 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?

Not directly,  but at least you  can make A.x  a higher-order function
taking y as parameter and then define y in B as

	let rec y ... = ... (A.x y) ...

Hope this helps,
-- 
Jean-Christophe