From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id F1AEDBC6C for ; Sat, 9 Feb 2008 20:02:30 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.25,327,1199660400"; d="scan'208";a="8990122" Received: from peray.inria.fr (HELO ausone.inria.fr) ([128.93.8.98]) by mail3-relais-sop.national.inria.fr with SMTP; 09 Feb 2008 20:02:30 +0100 Received: by ausone.inria.fr (sSMTP sendmail emulation); Sat, _d Feb 2008 20:01:24 +0100 From: "Nicolas Pouillard" Content-Type: text/plain; charset=UTF-8 Cc: bluestorm.dylc , caml-list Subject: Re: [Caml-list] small Camlp4 code : get a free name To: Edgar Friendly References: <527cf6bc0801231159o7c001a73lddd74e5b3cb30061@mail.gmail.com> <4797B314.8040008@gmail.com> In-Reply-To: <4797B314.8040008@gmail.com> Date: Sat, 09 Feb 2008 20:01:24 +0100 Message-Id: <1202583570-sup-2693@ausone.local> User-Agent: Sup/git X-Spam: no; 0.00; camlp:01 compiler:01 camlp:01 compiler:01 notation:01 edgar:98 wrote:01 caml-list:01 jambon:01 define:02 define:02 compiling:02 variables:02 seems:03 seems:03 Excerpts from Edgar Friendly's message of Wed Jan 23 22:35:16 +0100 2008: > Martin Jambon wrote: > > Nice, but in theory, it may create identifiers that are bound to an > > incorrect value when the programmer forgot to define such a value. > > > > For example, module A should provide A.x to module B (= another .ml file). > > If the programmer forgets to define A.x, the compiler should report the > > error at the time of compiling b.ml. But if some camlp4 extension > > operating over a.ml introduces a variable A.x and by chance it has the > > same type as the expected A.x, then the compiler will remain silent and > > B will use the wrong value for A.x. > > > > > > Martin > > > It seems to me that the only way to satisfy this requirement involves a > distinct namespace for these variables. Maybe > Camlp4.Unique_identifiers.? You cannot always use the dot notation. For instance <> would be wrong. > But this seems isomorphic to the simpler solution of claiming a portion > of the identifier space: __camlp4_unique_identifier_. Yes that's the poor man fresh function. Best regards, -- Nicolas Pouillard aka Ertai