Version française
Home     About     Download     Resources     Contact us    
Browse thread
Quotations and the functorial camlp4 interface
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Hendrik Tews <tews@o...>
Subject: Re: [Caml-list] Quotations and the functorial camlp4 interface
I wrote:

   How about the Loc submodule of Ast that is passed into
   OCamlInitSyntax? There is the mutable Loc.name, which contains
   the default location variable. If I reuse the Ast argument of
   OCamlInitSyntax, will the mutable Loc.name be shared between the
   outputs? 

Yes, it will, changing Loc.name has a global effect. 

What's more problematic is that the Loc sources are not
functorized, that is, there is only one instance
(Camlp4.Struct.Loc) that one can use. Consequently, Loc.name is a
kind of global Camlp4 reference, similar to
Camlp4_config.quotation and Camlp4_config.antiquotations.

   Are there syntax extensions in the camlp4 distribution
   that mutate Loc.name?

A grep for Loc.name yields only one place that changes Loc.name:
the option -loc in Camlp4Bin.ml. So the answer is probably no.

Bye,

Hendrik