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
Re : [Caml-list] Ask for a more efficient way to deallocate memory (full version)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Matthieu Wipliez <mwipliez@y...>
Subject: Re : [Caml-list] Ask for a more efficient way to deallocate memory (full version)
Error messages do are different:

> cat
let f a b =
  a + b *

> ocamlc -c
File "", line 3, characters 0-0:
Syntax error

> ocamlc -pp camlp4o.opt -c
File "", line 2, characters 6-7:
Parse error: [expr] expected after [infix operator (level 3) (start with '*', '/', '%')] (in [expr])
Preprocessor error

ocamlc standard parser gives erroneous position, and just complains about "Syntax error", while camlp4 is able to say precisely where the error occurred, and why (here because an expression is expected after the * infix operator). And this really makes the difference for tricky syntax errors (or when learning 
the language - I wish I had been taught of camlp4 back then ^^).

Matthieu Wipliez

----- Message d'origine ----
De : Yitzhak Mandelbaum <>
À : caml-list <>
Envoyé le : Mardi, 11 Décembre 2007, 3h03mn 57s
Objet : Re: [Caml-list] Ask for a more efficient way to deallocate memory (full version)

On Dec 10, 2007, at 5:59 PM, Jon Harrop wrote:

 However, using any camlp4 macros requires using the camlp4 replacement for the 
 front-end of the compiler. That uses a different parsing technology (top-down 
 recursive descent LL rather than bottom-up LALR) so the error messages from 
 the compiler are completely different.

Just to clarify : the error messages from the *parser* are completely different. Everything after the parser is the same with or without camlp4. Most importantly, you don't have to learn new type-checker messages.


Yitzhak Mandelbaum
AT&T Labs - Research


Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail