Browse thread
[Caml-list] OCaml popularity
-
Graham Guttocks
- Gerd Stolpmann
- Nicolas Cannasse
- Martin Weber
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| 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.
a.ml:
type id = { mutable id: 'a. 'a -> 'a }
let id = { id = fun _ -> failwith "A.id not defined yet" }
...
id.id 1, id.id true
b.ml:
let () = A.id.A.id <- (fun x -> prerr_endline "Got you!"; x)
Hope this helps,
Jacques
-------------------
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