From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 929C67FB5D for ; Sat, 3 Jan 2015 19:18:55 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of Xavier.Leroy@inria.fr) identity=pra; client-ip=212.27.42.3; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="Xavier.Leroy@inria.fr"; x-sender="Xavier.Leroy@inria.fr"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of Xavier.Leroy@inria.fr) identity=mailfrom; client-ip=212.27.42.3; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="Xavier.Leroy@inria.fr"; x-sender="Xavier.Leroy@inria.fr"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp3-g21.free.fr) identity=helo; client-ip=212.27.42.3; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="Xavier.Leroy@inria.fr"; x-sender="postmaster@smtp3-g21.free.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnIAALQxqFTUGyoDnGdsb2JhbABYA4c1xleCTwKBBBYBAQEBAREBAQEBAQYNCQkULoQMAQEBAwEjDwEgJQYLCxgCAgUWCwICCQMCAQIBRRMIAQGIIAyoQpNpAQEIAQEBAQEBHIEhjkYXEQWCUoFBBZcIgQ2Ed4gTgzmEEYMxAQEB X-IPAS-Result: AnIAALQxqFTUGyoDnGdsb2JhbABYA4c1xleCTwKBBBYBAQEBAREBAQEBAQYNCQkULoQMAQEBAwEjDwEgJQYLCxgCAgUWCwICCQMCAQIBRRMIAQGIIAyoQpNpAQEIAQEBAQEBHIEhjkYXEQWCUoFBBZcIgQ2Ed4gTgzmEEYMxAQEB X-IronPort-AV: E=Sophos;i="5.07,691,1413237600"; d="scan'208";a="115512862" Received: from smtp3-g21.free.fr ([212.27.42.3]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 03 Jan 2015 19:18:55 +0100 Received: from [192.168.1.2] (unknown [82.237.71.191]) by smtp3-g21.free.fr (Postfix) with ESMTP id 9BD61A6336 for ; Sat, 3 Jan 2015 19:17:23 +0100 (CET) Message-ID: <54A8328E.5020109@inria.fr> Date: Sat, 03 Jan 2015 19:18:54 +0100 From: Xavier Leroy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: caml-list@inria.fr References: <1088B954-0D62-47D9-B727-2ADE38DD3949@vu.nl> In-Reply-To: <1088B954-0D62-47D9-B727-2ADE38DD3949@vu.nl> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] ocamldep & compilation units On 02/01/15 15:03, Remco Vermeulen wrote: > baz.ml: > open Foo > ... > BAR.x () > … > Bar.y () > > ocamldep -modules baz.ml, as used by Omake, returns baz.ml: BAR bar. To add to the useful answers already given, another way to work around this issue is to use explicit qualification for BAR: open Foo ... Foo.BAR.x () … Bar.y () That will prevent ocamldep from mistaking BAR for a compilation unit. Gerd Stolpmann adds: > But imagine now we had the information with this degree of detail. As > omake wants to figure out the dependencies it would have to solve a > puzzle. In your case it is easily to solve, but in practice there are > often several "open" directives, and in this case you don't even know > whether "open Foo" opens a compilation unit. I am not sure whether a > well-performing algorithm even exists (did anybody tackle this > problem?). Matthias Blume showed a NP-completeness result for a closely-related problem: Matthias Blume: Dependency analysis for Standard ML. ACM Trans. Program. Lang. Syst. 21(4): 790-812 (1999) - Xavier Leroy