[
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: | Jérémie_Lumbroso <jeremie.lumbroso@e...> |
| Subject: | Re: Multiple value declaration in .mli file |
On Fri, Aug 15, 2008 at 7:07 PM, Jérémie Lumbroso <jeremie.lumbroso@etu.upmc.fr> wrote: >> I guess you need it to mirror the value shadowing on the implementation side: >> include Foo >> let bar = baz >> >> This is legal if Foo already defines bar, and most of the time desired and >> useful. >> In the interface file you'll want to write : >> include FOO (* Foo's signature *) >> val bar : ... > > Actually, this is untrue. I think that up until recently (3.09.2?), what > you describe would have caused an error (one of the many annoying things > about signatures in ML languages that prompted that clever paper by Ramsey > et al.). I may have gotten carried away! :-) I was thinking of type definitions, and have no idea if the behavior for values was the same. <toplevel> # module type Foo = sig type t = int end;; module type Foo = sig type t = int end # module type Bar = sig include Foo type t = string end;; Multiple definition of the type name t. Names must be unique in a given structure or signature. </toplevel> Jérémie