Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] Slight parsing difference with/without -pp "camlp4o"
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Michel Mauny <Michel.Mauny@i...>
Subject: Re: [Caml-list] Slight parsing difference with/without -pp "camlp4o"
Peter Jolly wrote/écrivait (Wed, Jul 28, 2004 at 06:02:34PM +0100):
> 
> Camlp4o is also more permissive with "with" in record constructions:

Right, but that one is difficult to fix.

What happens is that Camlp4 and OCaml use different parsing
technologies, Camlp4 has to do a lot of (sometimes dirty) work to be
able to parse all OCaml programs. The result is that slightly more
programs are accepted by camlp4o than by ocaml, which is better than
the other way around ;-)

I'm afraid that nothing useful can be done here.

-- Michel

>   $ cat test.ml
>   type t = { a: int }
>   let f() = { a = 0 }
>   let y = { f() with a = 1 }
> 
>   $ ocamlc -pp camlp4o test.ml
>   $ ocamlc test.ml
>   File "test.ml", line 3, characters 11-12:
>   Syntax error

-------------------
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