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
[Caml-list] lisp -> ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-05-22 (16:52)
From: Markus Mottl <mottl@m...>
Subject: Re: [Caml-list] lisp -> ocaml
On Tue, 22 May 2001, Miles Egan wrote:
> Which fails to compile, for obvious reasons.  Is the solution to
> refactor the code into a nonrecursive form?  In the absence of forward
> declarations, I'm not sure what else to do.

No, you have to explicitly express that the two functions are mutually
recursive by using the "and" keyword as in, e.g.:

  let rec f () = g ()
  and g () = f ()

Markus Mottl

Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr