Version française
Home     About     Download     Resources     Contact us    
Browse thread
Camlp4's (lack of) hygiene (was Re: Macros)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Judicael Courant <Judicael.Courant@l...>
Subject: Re: Camlp4's (lack of) hygiene (was Re: Macros)
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