Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] camlp4 and syntax modifications
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-04-03 (09:21)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: [Caml-list] camlp4 and syntax modifications

On Wed, Apr 03, 2002 at 10:49:06AM +0200, Frederic Tronel wrote:

> I'm using camlp4 to embed a specification language (Lotos)
> into caml. I've written quotations that allow to write and
> use Lotos expressions directly in my caml code. But I'm facing
> a problem with what appears to be slight syntax changes. Here's
> an example:

I think that you did not understand how to use the quotations: the
"original" syntax (camlp4o), like you say, does not concern the
contents of the quotations, but only the rest of your program (what
is *not* in the quotations).

What is inside the quotations is treated by your quotation expander
which, depending on how you programmed it, can parse C, Java, Fortran,
Basic, Calculus of Constructions, English, Slang, String, ignored
garbage, Lambda Calculus, APL, HTML... anything.

Therefore, we first need to see the code of your quotation expander.

Second: you don't have to open your quotation expander file in your
program. The statement "open Lotos" is unuseful. The quotation
expander is for *parsing* time, not for *execution* time.
If you need specific library functions, it is better to put them in
another file, because the code in your file concerns
syntactic statements which you probably don't need at execution time.

When you use Camlp4, you need to understand the difference between
   - what is of the level of the "compiler" (camlp4) and 
   - what is of the level of your program

Feel free to ask more information if you need.

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: