From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA17298 for caml-red; Sun, 16 Jul 2000 23:48:05 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA27501 for ; Mon, 10 Jul 2000 13:42:36 +0200 (MET DST) Received: from ext.lri.fr (ext.lri.fr [129.175.15.4]) by nez-perce.inria.fr (8.10.0/8.10.0) with ESMTP id e6ABgZ102734 for ; Mon, 10 Jul 2000 13:42:35 +0200 (MET DST) Received: from pc87.lri.fr (pc87 [129.175.8.106]) by ext.lri.fr (8.9.3/jtpda-5.3.2) with ESMTP id NAA26208 ; Mon, 10 Jul 2000 13:42:33 +0200 (MET DST) Received: from pc87.lri.fr by pc87.lri.fr (8.9.3/feuille) with ESMTP id NAA02925 ; Mon, 10 Jul 2000 13:42:28 +0200 Message-Id: <200007101142.NAA02925@pc87.lri.fr> Date: Mon, 10 Jul 2000 13:42:25 +0200 (MEST) From: Judicael Courant Subject: Re: Camlp4's (lack of) hygiene (was Re: Macros) To: John Prevost cc: caml-list@inria.fr In-Reply-To: <87r995jynp.fsf@isil.localdomain> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Sender: weis@pauillac.inria.fr On 7 jui, John Prevost wrote: > Somebody on clf pointed out the other bigger part of hygiene, which is > allowing symbols which *are* bound in the "macro" source to be > statically bound to that value when used. Unfortunately, I don't > think this is a change that's at all simple for camlp4, since it > requires very tight coupling with the compiler. > Notice that even O'Caml itself (I mean without camlp4) already has this problem: Objective Caml version 3.00+8 (2000-06-30) # let x = [| 1 ; 2 |];; val x : int array = [|1; 2|] # module Array = struct end;; module Array : sig end # x.(1);; (* guess what happens... *) Unbound value Array.get # (* x.(1) just expands to Array.get x 1 *) Judicaël. -- Judicael.Courant@lri.fr, http://www.lri.fr/~jcourant/ (+33) (0)1 69 15 64 85 "Montre moi des morceaux de ton monde, et je te montrerai le mien" Tim, matricule #929, condamné ŕ mort. http://rozenn.picard.free.fr/tim.html