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 3F81F7F0A6 for ; Thu, 20 Aug 2015 16:01:37 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of fabrissimo@gmail.com) identity=pra; client-ip=209.85.215.51; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="fabrissimo@gmail.com"; x-sender="fabrissimo@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of fabrissimo@gmail.com designates 209.85.215.51 as permitted sender) identity=mailfrom; client-ip=209.85.215.51; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="fabrissimo@gmail.com"; x-sender="fabrissimo@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-la0-f51.google.com) identity=helo; client-ip=209.85.215.51; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="fabrissimo@gmail.com"; x-sender="postmaster@mail-la0-f51.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0ACAQB/3dVVmzPXVdFdg29pBoMfqXKSQIcpB0wBAQEBAQESAQEBAQEGCwsJIS6EJAEBBBIRBBkBLQsBAwwBBQULDQICCR0CAiISAQUBChIGExIQh3cDEg2sD4EvPjGLQIRlixAnAwqFVyYBBQ6BFIM3hnqCZjGBGoNJgUMFhW8Mjy6FBYdqgUpGlEKCHRIjgRcXSYFUHIFVPDMBAYEDgUcBAQE X-IPAS-Result: A0ACAQB/3dVVmzPXVdFdg29pBoMfqXKSQIcpB0wBAQEBAQESAQEBAQEGCwsJIS6EJAEBBBIRBBkBLQsBAwwBBQULDQICCR0CAiISAQUBChIGExIQh3cDEg2sD4EvPjGLQIRlixAnAwqFVyYBBQ6BFIM3hnqCZjGBGoNJgUMFhW8Mjy6FBYdqgUpGlEKCHRIjgRcXSYFUHIFVPDMBAYEDgUcBAQE X-IronPort-AV: E=Sophos;i="5.15,714,1432591200"; d="scan'208";a="143366342" Received: from mail-la0-f51.google.com ([209.85.215.51]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 20 Aug 2015 16:01:25 +0200 Received: by lagz9 with SMTP id z9so23091736lag.3; Thu, 20 Aug 2015 07:01:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=jRn9qC3aJnzP8/zZQFeNaq8XbN3vyCK23ry5WeeSvec=; b=qmX6RLJcPl15w6IpEcEdFz5lEx3TWJbyMoEpZzElxRgK4zoI0Uz6l9kG5FegZA0pHO Qb+z3JcovGN7zXSPX/D/X6ggtw9vcoW4o+KYqmauJLwIE3AUM68iHOCP3K4xanR44Owg B4HAnwOmpjhSPRU7kDkXn//dmlthi63nhTU3PC9fMeO+o4kDR7QtC1pm2sZQLeR3xIcx 8D2JGgY/96rsPegvL4itdhhHwxGhMLlkBtBFdGwpxUXG+shW0ZvRu1AVZFaACiBNw39d NnLPP4o8k7BJT3/bJcN903squJ8PWO8L9bImZYkef3+E6QhhX9Zp2yJ9BXGZxV4QPg4r zscg== X-Received: by 10.152.42.244 with SMTP id r20mr3077196lal.90.1440079284810; Thu, 20 Aug 2015 07:01:24 -0700 (PDT) MIME-Version: 1.0 Sender: fabrissimo@gmail.com Received: by 10.25.125.4 with HTTP; Thu, 20 Aug 2015 07:01:05 -0700 (PDT) In-Reply-To: <55D5D7C6.5050300@inria.fr> References: <55D5D7C6.5050300@inria.fr> From: Fabrice Le Fessant Date: Thu, 20 Aug 2015 16:01:05 +0200 X-Google-Sender-Auth: OKc7qDBXARAvOpu9XobKOQAEdgk Message-ID: To: Francois Berenger Cc: caml users Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] getting rid of ocamlbuild's .mlpack files in a project Well, that would work for non-recursive modules. If you have recursive modules (for example, A contains "val f : t -> B.t" and B contains "val f : t -> A.t"), you will need to use recursive modules "module rec Toto ..." and find two limitations : 1/ "module rec" requires all your modules to have a signature, whereas your .mlpack file could contain modules without .mli files, and still work with recursive modules 2/ the shape and ordering of modules in "module rec" is limited, and it is possible to have recursive toplevel modules that can just not be included in a "module rec": for example, if you use a toplevel "include" in one of the modules. There is a tool that does automatically what you did: see "ocp-pack" in http://www.ocamlpro.com/blog/2011/08/10/ocaml-pack-functors.html I used it on Alt-Ergo, and could not compile it because of the above restrictions... --Fabrice On Thu, Aug 20, 2015 at 3:36 PM, Francois Berenger wrote: > Dear list, > > Just a quick note for posterity on how to remove a .mlpack file > from a project, since Google was not my friend on this subject. > > .mlpack files are a feature supported by ocamlbuild. > As documented in section 18.3.16 of > http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual032.html > > I think only ocamlbuild supports .mlpack files. > So, you might want to get rid of them because you are switching > a project to another build system. > Or, maybe, you want the "feature" without becoming bound to ocamlbuild. > > In any case, here is a recipe that works for me. > > I replaced the file > > util.mlpack > --- > util/Toto > --- > > by the file > > util.mlp > --- > module Toto : > sig > #include "util/toto.mli" > end = struct > #include "util/toto.ml" > end > --- > > Then, using the excellent cppo ocaml preprocessor from Martin Jambon, > you can do: > > cppo util.mlp > util.ml > > I think this util.ml file does explicitely what the util.mlpack file was > doing when processed by ocamlbuild, at the cost of a preprocessing step. > > Best regards, > Francois. > > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs -- Fabrice LE FESSANT Chercheur en Informatique INRIA Paris Rocquencourt -- OCamlPro Programming Languages and Distributed Systems