Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Basile STARYNKEVITCH <Basile.Starynkevitch@cea.fr>
To: caml-list@inria.fr
Subject: type declaration in */mli & *.ml
Date: Mon, 21 Oct 1996 11:23:25 +0200	[thread overview]
Message-ID: <199610210923.LAA01989@soleil.serma.cea.fr> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1988 bytes --]



Hello All,

It seems that when a type is declared in the interface of a module Moo
-ie in the file moo.mli- it should also be declared in the
implementation of the same module Moo -ie in the file moo.ml-.

For instance, in directory ocaml-1.02/toplevel the file toploop.mli
contains

(*################ from toplevel/toploop.mli *)

(* Interface with toplevel directives *)

type directive_fun =
    Directive_none of (unit -> unit)
  | Directive_string of (string -> unit)
  | Directive_int of (int -> unit)
  | Directive_ident of (Longident.t -> unit)


(*############### end of sample ################*)

while the file toploop.ml also contains

(*############# from toplevel/toploop.ml ################*)

type directive_fun =
    Directive_none of (unit -> unit)
  | Directive_string of (string -> unit)
  | Directive_int of (int -> unit)
  | Directive_ident of (Longident.t -> unit)

(*################ end of sample ################*)

I don't understand why is it so, and I feel such a redundancy is very
annoying.

Any hints or explanations?

(perhaps I could paraphrase my question: does an implementation file
moo.ml of a module Moo contain an implicit open Moo;; ??)

Thanks for reading.

N.B. Any opinions expressed here are solely mine, and not of my organization.
N.B. Les opinions exprimees ici me sont personnelles et n engagent pas le CEA.

Please cite a *pertinent part* of my mail in all answers
Veuillez citer une *partie pertinente* de mon courrier dans vos reponses



----------------------------------------------------------------------
Basile STARYNKEVITCH   ----  Commissariat à l Energie Atomique 
DRN/DMT/SERMA * CEA/Saclay bat.470 * 91191 GIF/YVETTE CEDEX * France
fax: (33) 01,69.08.85.68; phone: 01,69.08.40.66; home: 01,46.65.45.53
email: Basile.Starynkevitch@cea.fr (or else basile@soleil.serma.cea.fr);  
I speak french, english, russian. Je parle français, anglais, russe.
----------------------------------------------------------------------






             reply	other threads:[~1996-10-22 14:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-21  9:23 Basile STARYNKEVITCH [this message]
1996-10-23  9:29 ` Xavier Leroy
1997-10-01 10:02 Hendrik Tews
1997-10-04 15:14 ` kahl
1997-10-03 16:34 Manuel Fahndrich
1997-10-06 11:51 ` U-E59264-Osman Buyukisik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199610210923.LAA01989@soleil.serma.cea.fr \
    --to=basile.starynkevitch@cea.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox