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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id F027C7F530 for ; Wed, 5 Dec 2012 00:00:02 +0100 (CET) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.210.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.210.182 as permitted sender) identity=mailfrom; client-ip=209.85.210.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ia0-f182.google.com) identity=helo; client-ip=209.85.210.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-ia0-f182.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjkCAD1/vlDRVdK2m2dsb2JhbABEq2WSQwgWDgEBAQEBCAkUFCeCHgEBBScZARsSCwEDDAYFCw0NISEBAREBBQEKEgYTCAoJh2IBAw8MoXaMM4FwgQqFIgoZJwMKWYh1AQUMi0JphEEDlC2BVoEcihuDMBYphBQ X-IronPort-AV: E=Sophos;i="4.84,217,1355094000"; d="scan'208";a="164778407" Received: from mail-ia0-f182.google.com ([209.85.210.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 05 Dec 2012 00:00:02 +0100 Received: by mail-ia0-f182.google.com with SMTP id x2so5291297iad.27 for ; Tue, 04 Dec 2012 15:00:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=gpwLAnLTwDRsQIzq5XiGhW215ZuFlEmjzXOFKHFlwRY=; b=ZheT2yRXZSJQwYl8UTHdpuDv/gMM7QwhmeOfD8H2tXrkZqsh8dG0m1ydmnfbu8yxF/ 4YVSTm5aR7d7vmFaXDN43fh3qe6p6NTfsjM1WeAgj44WtdvkWU5RFqY8z2C0P5jYH7rJ dJDBrKEpJQyDuIQqrxEz4RIvwJ3WcSOZfmH93jZ5apKCZkxf/IiODaVNDWGjIu3Mllml +Nh/d7KU/ZFIegYg3xBPR7pwTpa5JKOzQw8ggl9o98lJSzKqecs/JJCj7e0AHaMzUc1x Cifu9cK+0aHi3Z6CwUzuv8XGBNAAIRrksTulMxX0UNLecfTYB/yPIhbwqroDnPlkPwWJ IOdg== Received: by 10.42.138.74 with SMTP id b10mr12803275icu.33.1354662000937; Tue, 04 Dec 2012 15:00:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.184.199 with HTTP; Tue, 4 Dec 2012 14:59:20 -0800 (PST) In-Reply-To: References: From: Gabriel Scherer Date: Tue, 4 Dec 2012 23:59:20 +0100 Message-ID: To: bob zhang Cc: Caml List Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] Absolute path in the module system As far as I know, the answer is that you can't do that. In fact I don't even know how you would do that: there is a tension between powerful naming constructs and stability of references, and I don't know how you would provide global references in a satisfying way. This is a classic problem of hygienic macro systems. They are supposed to protect two different aspects of bound identifiers "hygiene": - new definition inside macros do not shadow identifiers in scope at macro invocation/expansion time (it is possible, but not simple, to emulate this property with careful preservation of scope during macro-expansion) - identifiers referenced by macro definitions are not shadowed by identifier added in scope after that, before macro invocation/expansion time; this corresponds to your question and I don't think how you would solve that with a static expansion scheme. If I remember correctly, the solution of hygienic macro systems is, in effect, to do a preprocessing step of the pre-expansion source, to enforce the convention that now name is bound twice in the same scope by appending unique suffixes to identifiers. On Tue, Dec 4, 2012 at 9:43 PM, bob zhang wrote: > Dear List, > Is there a way to express the absolute module path? > For example, > Pervasives.(+) --> actually I want it to be absolute Pervasives > module, not shadowed by any 'open' statements? > Is there a way to do that? if not, is there any deep reason for > not doing this? > > Thanks > > -- > Regards > -- Bob > > -- > 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