From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA28931; Sat, 12 Oct 2002 13:32:23 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA28537 for ; Sat, 12 Oct 2002 13:32:22 +0200 (MET DST) Received: from mel-rto6.wanadoo.fr (smtp-out-6.wanadoo.fr [193.252.19.25]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g9CBWM525532 for ; Sat, 12 Oct 2002 13:32:22 +0200 (MET DST) Received: from mel-rta10.wanadoo.fr (193.252.19.193) by mel-rto6.wanadoo.fr (6.5.007) id 3DA24D4D00300DF4; Sat, 12 Oct 2002 13:32:13 +0200 Received: from warp (81.49.32.85) by mel-rta10.wanadoo.fr (6.5.007) id 3DA24C0A003142CF; Sat, 12 Oct 2002 13:32:13 +0200 Message-ID: <005701c271e3$30eb3130$55203151@warp> From: "Nicolas Cannasse" To: "Yang Shouxun" , References: <3DA8021B.3050102@fltrp.com> Subject: Re: [Caml-list] automatic extraction of mli file? Date: Sat, 12 Oct 2002 13:33:30 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > What I'm wondering is "wouldn't it be preferrable to automatically > produce the interface file from the implementation file?", so that we > can program in the literate programming style, do prototyping, and save > the drudgery of writing the interface (though a little manual editing > may be necessary, or some kind of markup in the source code). > > Maybe such utility already exists. Only I'm not aware of. If so, I'd > like to know how to get it. The "-i" ocamlc compiler flag is what you need. It prints all the types found in the ML file. But since there is no rule for interface exclusion, you have to maintain separatly both ML & MLI files. For example, if you start working on a new module, you can start writing it without any interface ( then all members are "public" ) and after some testing you write the interface and that way ensure that your implemenation match exactly what's in your mind ( not always obvious :) Nicolas Cannasse ------------------- 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