Version française
Home     About     Download     Resources     Contact us    
Browse thread
2 camlp4 questions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Martin Jambon <martin.jambon@e...>
Subject: Re: [Caml-list] 2 camlp4 questions
On Thu, 5 Apr 2007, Hendrik Tews wrote:

> Hi,
>
> I am still reading the camlp4 sources:
>
> 1. Is there a special @loc quotation form? For instance in
>    camlp4/Camlp4Bin.ml line 141
>
>   [ <:sig_item@loc< # $n$ $str:s$ >> -> Some (loc, n, s)
>
>    What does it do? Or is ``sig_item@loc'' just the identifier of
>    the quotation expander?

I can answer this one: @x means "bind the location to x". Before you had
to extract the location explicitely using one of the MLast.loc_of_*
functions.

It's not done by default using _loc because of cases like this one:

match e1, e2 with
  <:expr< ...>>, <:expr< ... >> -> ...


Martin

--
Martin Jambon
http://martin.jambon.free.fr