Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] A question about Camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Frederic Tronel <Frederic.Tronel@i...>
Subject: Re: [Caml-list] A question about Camlp4
Remi Vanicat wrote:

> 
> there is an "hidden" loc "argument" to expr quotation, and this loc
> variable is defined in the action.
> 
> let optionToAst loc o =
> match o with
> | None -> <:expr<None>>
> | Some x -> <:expr<Some $x>>
> 
> then you could call "optionToAst loc a" and it will work...


Thank you, it does work.
Is it documented somewhere ? (I know that "loc" is used in the source 
location).


Best regards,

Frederic.




-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners