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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id AFD7E7EE6A for ; Fri, 31 May 2013 07:31:42 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of mmatalka@gmail.com) identity=pra; client-ip=74.125.83.50; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="mmatalka@gmail.com"; x-sender="mmatalka@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of mmatalka@gmail.com designates 74.125.83.50 as permitted sender) identity=mailfrom; client-ip=74.125.83.50; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="mmatalka@gmail.com"; x-sender="mmatalka@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ee0-f50.google.com) identity=helo; client-ip=74.125.83.50; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="mmatalka@gmail.com"; x-sender="postmaster@mail-ee0-f50.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArQAAD41qFFKfVMyjmdsb2JhbABZgmi/OoECFg4BAQEBBw0JCRIGJIIjAQEEAUABGx0BAwELBgULFiUPAQQPEQEFASITh3oBAwkGAZ1DjEiCfYRxChknDViIBAEFDI8QB4NXA5Ntg1GPWz+ENQ X-IPAS-Result: ArQAAD41qFFKfVMyjmdsb2JhbABZgmi/OoECFg4BAQEBBw0JCRIGJIIjAQEEAUABGx0BAwELBgULFiUPAQQPEQEFASITh3oBAwkGAZ1DjEiCfYRxChknDViIBAEFDI8QB4NXA5Ntg1GPWz+ENQ X-IronPort-AV: E=Sophos;i="4.87,776,1363129200"; d="scan'208";a="16277636" Received: from mail-ee0-f50.google.com ([74.125.83.50]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 31 May 2013 07:31:42 +0200 Received: by mail-ee0-f50.google.com with SMTP id c41so65249eek.23 for ; Thu, 30 May 2013 22:31:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=w6QaPs+vCL5krYOJVh26tMR/sR2hclCx0fY8kJVm3ck=; b=PSd1RLQMJtw7HWP4M0+nQ3tuarSYApw2G5k7pn54N/u90zU861LMdS7+1QqjS1etRD CNbcrk/YUK1qmKe3/TFbxUunbjy57t5T3zo/pDzoYkUQkylWX119jl3COfTljZwHYGmp Fc3BS7dHycyQfcv8dAmkW4IQxjUyH5PBVRfVg+0tnOCf7NXStoyFfT/BRRgY93bgZfel jkMxxkW6tGGE1fPrwS16+Hdr2aH8S2Bpy0UXR8GcO4/Aj2Ju3Mhkk2zBHwkvabmlVgOM URbrBg03zXa2mWmf2NG4Jhyfb7FZvXdgsP+UJUsAYVqWcsfc6DiHi7ZGtKLi6z16UzRR Sl6g== X-Received: by 10.14.107.69 with SMTP id n45mr12109110eeg.67.1369978301462; Thu, 30 May 2013 22:31:41 -0700 (PDT) Received: from localhost ([2a01:7e00::f03c:91ff:fe70:2696]) by mx.google.com with ESMTPSA id z52sm64501160eea.1.2013.05.30.22.31.40 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 30 May 2013 22:31:41 -0700 (PDT) From: Malcolm Matalka To: Francois Berenger Cc: caml-list References: <51A81C67.50902@riken.jp> Date: Fri, 31 May 2013 05:31:40 +0000 In-Reply-To: <51A81C67.50902@riken.jp> (Francois Berenger's message of "Fri, 31 May 2013 12:43:35 +0900") Message-ID: <87bo7rogub.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Caml-list] automatic extaction of the .mli (and a little more) from the .ml 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. /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.