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] OCaml popularity
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-03-17 (02:21)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: Module recursion (Was Re: [Caml-list] Re: Haskell-like syntax)
From: brogoff@speakeasy.net

> Of the two issues you bring up, I think having the ability to have mutually 
> recursive functions across module boundaries is *by far* more important than 
> the ability to spread types across module boundaries. We can sort of do it 
> now, with references, but we have the same problem as with theworkaround I 
> mentioned for "where": reduced polymorphism. 

Not so since 3.05: you have to be explicit, but you can define
polymorphic mutable values.

type id = { mutable id: 'a. 'a -> 'a }
let id = { id = fun _ -> failwith "A.id not defined yet" }
   id.id 1, id.id true

let () = A.id.A.id <- (fun x -> prerr_endline "Got you!"; x)

Hope this helps,


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