From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 0F4227EE6A for ; Fri, 31 May 2013 17:21:12 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of bobzhang1988@gmail.com) identity=pra; client-ip=209.85.220.171; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="bobzhang1988@gmail.com"; x-sender="bobzhang1988@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of bobzhang1988@gmail.com designates 209.85.220.171 as permitted sender) identity=mailfrom; client-ip=209.85.220.171; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="bobzhang1988@gmail.com"; x-sender="bobzhang1988@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-vc0-f171.google.com) identity=helo; client-ip=209.85.220.171; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="bobzhang1988@gmail.com"; x-sender="postmaster@mail-vc0-f171.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvwAAJK+qFHRVdyrlGdsb2JhbABawiOBAhYOAQEBAQcLCwkSKoIjAQEBBAEBATUIARscAQEDDAYFCwMKCRYPCQMCAQIBEREBBQEcBg0BBQIBAYd2AQMPnGOMSoJ9hQAKGScNWIgGAQUMjxUHg1cDk22DUY9bP4RR X-IPAS-Result: AvwAAJK+qFHRVdyrlGdsb2JhbABawiOBAhYOAQEBAQcLCwkSKoIjAQEBBAEBATUIARscAQEDDAYFCwMKCRYPCQMCAQIBEREBBQEcBg0BBQIBAYd2AQMPnGOMSoJ9hQAKGScNWIgGAQUMjxUHg1cDk22DUY9bP4RR X-IronPort-AV: E=Sophos;i="4.87,779,1363129200"; d="scan'208";a="19809836" Received: from mail-vc0-f171.google.com ([209.85.220.171]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 31 May 2013 17:21:11 +0200 Received: by mail-vc0-f171.google.com with SMTP id m16so491788vca.16 for ; Fri, 31 May 2013 08:21:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:newsgroups:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=azFRIIj+gszPQf/DdS5Fw03H6z0L9Frh+9IQQP/Ksb8=; b=UYYTMc6VkLDkdcBBaYcMJIi+t7f1KJazMOoY119jaQa7snySPfm4RmwVjG3IXb2EI1 iQG1/vEyBFglEONeeoKIp97ISTYbpMlMR/N9gvir+7gnSCjq7MrGLYydf4TM0idLx061 sCSUvF6/qqDQh0eyNMloeuoKF0wbonNNtQLgvehX2WwH+sHL3QQtGgGaRCZjAnn4PP9q D+sYrkClLnJrOOn5P/uBWDhfkU+tt806FJdJt5FdwbZTSLySAfzOtm8PMj0S5rMXJa7a r6CtwSYi3ZMQW12YJVZrW8sFwnNCo/ZCUcl49szozBkPvfxpmufPRa8ae/g4p2vKAH3s Nwqw== X-Received: by 10.220.3.144 with SMTP id 16mr10632079vcn.6.1370013670315; Fri, 31 May 2013 08:21:10 -0700 (PDT) Received: from Hongbos-MacBook-Air.local ([66.250.143.158]) by mx.google.com with ESMTPSA id k15sm36011732vde.11.2013.05.31.08.21.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 May 2013 08:21:09 -0700 (PDT) Message-ID: <51A8BFE4.9060709@gmail.com> Date: Fri, 31 May 2013 11:21:08 -0400 From: Hongbo Zhang User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 Newsgroups: gmane.comp.lang.caml.inria To: Malcolm Matalka CC: Francois Berenger , caml-list References: <51A81C67.50902@riken.jp> <87bo7rogub.fsf@gmail.com> In-Reply-To: <87bo7rogub.fsf@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Caml-list] Re: automatic extaction of the .mli (and a little more) from the .ml On 5/31/13 1:31 AM, Malcolm Matalka wrote: > I know of no such tool, but in counter to your premise: I used to think > maintaining a .ml and .mli was foolish, however I no longer do. .mli is > effectively documentation for me. It contains a lot of comments and is > generally written to reflect how the API should be used rather than the > order in which I must express functions to get ta .ml to compile. On > top of that, ocamlc will fail to compile if your .ml and .mli don't > match, so it's a valuable check that what I think my module does is also > what the compiler does. I also tend to write the .mli first, then write > the .ml. I find it to be a great way to develop. > > In short, I think it's a good thing to maintain these things by hand. > But as for your original question I'm completely useless, sorry. > I had the same experience with you, after writing some large software in ML, I found it better to maintain mli by hand. > /M > > Francois Berenger writes: > >> Hello, >> >> Is there some recommended tool/script to generate a .mli >> from the corresponding .ml? >> >> I want a little more than ocamlc -i: >> >> - I think there should be tags in the .ml file as comments >> that say "export this" to the .mli. >> By default, things are not exported. >> - maybe it should have an option to say to replicate >> the ocamldoc comments in the .mli. >> - it could be nice if the order in which things are exported >> to the .mli can be specified, maybe as an argument of the tag. >> So that the .mli can be more readable (only backward references >> to concepts, etc.) >> >> If there is a need to create a tool, let's call it "nomli". :) >> >> Regards, >> F. >> >> PS: I'm not going to maintain both a .mli and a .ml. >> I feel it is a dumb and error-prone job and that >> itches me. >