Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Matthieu Wipliez <mwipliez@yahoo.fr>
To: caml-list <caml-list@yquem.inria.fr>
Subject: Re : [Caml-list] Ask for a more efficient way to deallocate memory (full version)
Date: Tue, 11 Dec 2007 09:56:52 +0000 (GMT)	[thread overview]
Message-ID: <346815.54459.qm@web27001.mail.ukl.yahoo.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1985 bytes --]

Error messages do are different:

> cat syntax_error.ml
let f a b =
  a + b *

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

> ocamlc -pp camlp4o.opt -c syntax_error.ml
File "syntax_error.ml", 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 <yitzhak@research.att.com>
À : caml-list <caml-list@yquem.inria.fr>
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

 --------------------------------------------------
Yitzhak Mandelbaum
AT&T Labs - Research


http://www.research.att.com/~yitzhak

 







      _____________________________________________________________________________ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail http://mail.yahoo.fr

[-- Attachment #2: Type: text/html, Size: 5665 bytes --]

             reply	other threads:[~2007-12-11  9:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-11  9:56 Matthieu Wipliez [this message]
2007-12-12  6:54 ` Camlp4 error messages (was Re: Re : [Caml-list] Ask for a more efficient way to deallocate memory) David Teller
2007-12-16 12:52 Re : [Caml-list] Ask for a more efficient way to deallocate memory (full version) Matthieu Wipliez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=346815.54459.qm@web27001.mail.ukl.yahoo.com \
    --to=mwipliez@yahoo.fr \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox