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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nicolas Pouillard <nicolas.pouillard@g...>
Subject: Re: [Caml-list] camlp4 questions
On 7/23/07, Christophe Raffalli <Christophe.Raffalli@univ-savoie.fr> wrote:
>
> Dear list members,
>
> I am finishing to port binlib to camlp4 of 3.10 and have a few problems
> left :
>
> 1) a bug in my extension, I have:
>
[...]

> produces the following error message:
>
> File "programs.ml", line 1259, characters 1-48:
> Failure: "expr, expr: not allowed here"
> Preprocessor error

This is because a comma node as been encountered << $_$, $_$ >>
without it's surrounding tuple node << ($tup:_$) >>. In other words
you have to put more parenthesis in your extension.

> 2) with 3.09 I used to produce a bytecode similar to camlp4o with my
> extension buildin. I could not find
> the proper line to compile this bytecode (I tried to copy the compile
> line of camlp4o and to add
> pa_bindlib.cmo somewhere, but I failed)

Jeremy Yallop has explained this in a previous email [1] while
building deriving, it will be soon integrated to the documentation.

[1]: http://caml.inria.fr/pub/ml-archives/caml-list/2007/06/a568d6eb0631a9a4ea0542109695a76f.fr.html

> 3) I like the fact that my new delimiter "(^", "^)", ... are now
> supported by the standard lexer of camlp4, But I think
> that spaces should not be mandatory between delimiters and therefore,
> keywords should only be allowed to contain
> one "(", "{" or "[" at the beginning and/or one ")","}","]" at the end.
> Still, I prefer the 3.10 version needing a few extra spaces that having
> to rewrite my own lexer.

I don't know how to do that without breaking any existing OCaml source code.

Regards,

-- 
Nicolas Pouillard