From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, HTML_MESSAGE autolearn=disabled version=3.1.3 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 34702BC6B for ; Tue, 11 Dec 2007 10:56:56 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAADLuXUfZkrEBn2dsb2JhbACCcox1AgEBBwQGCQgY X-IronPort-AV: E=Sophos;i="4.24,150,1196636400"; d="scan'208,217";a="5513775" Received: from web27001.mail.ukl.yahoo.com ([217.146.177.1]) by mail1-smtp-roc.national.inria.fr with SMTP; 11 Dec 2007 10:56:53 +0100 Received: (qmail 56932 invoked by uid 60001); 11 Dec 2007 09:56:52 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.fr; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=0R9LTgxfYHxxZCRDtp0V+3Q8y1nzfn/NQY7F8yMkBHYPzOei12oJdHmf76MEveKm/15tCYDnvfb+8qYB64ti6oU35GbXDSxlmxUVO+P8Ndgg2gGtO81AXv7jqyXlDbt/2pqWwT2RqbwQF5AOW8B3FH+uyV5SwdCN09uA1redeXw=; X-YMail-OSG: JqE685sVM1n9IdUX7zdT18dVRbxhMp0E.IIwuy8WSeE1zfNVD9HC1XUfB2a7GTl23YNUU1AHqO.nPkTjsh9cQ_var9bb1hiC0eFamuAZZtAF20ok20D_SM.HlDg- Received: from [193.52.94.40] by web27001.mail.ukl.yahoo.com via HTTP; Tue, 11 Dec 2007 09:56:52 GMT X-Mailer: YahooMailRC/818.31 YahooMailWebService/0.7.158.1 Date: Tue, 11 Dec 2007 09:56:52 +0000 (GMT) From: Matthieu Wipliez Subject: Re : [Caml-list] Ask for a more efficient way to deallocate memory (full version) To: caml-list MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1240555290-1197367012=:54459" Message-ID: <346815.54459.qm@web27001.mail.ukl.yahoo.com> X-Spam: no; 0.00; matthieu:01 syntax:01 ocamlc:01 syntax:01 ocamlc:01 -pp:01 camlp:01 expr:01 infix:01 expr:01 parser:01 camlp:01 infix:01 matthieu:01 yitzhak:01 X-Attachments: cset="utf-8" cset="utf-8" --0-1240555290-1197367012=:54459 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Error messages do are different:=0A=0A> cat syntax_error.ml=0Alet f a b =3D= =0A a + b *=0A=0A> ocamlc -c syntax_error.ml=0AFile "syntax_error.ml", lin= e 3, characters 0-0:=0ASyntax error=0A=0A> ocamlc -pp camlp4o.opt -c syntax= _error.ml=0AFile "syntax_error.ml", line 2, characters 6-7:=0AParse error: = [expr] expected after [infix operator (level 3) (start with '*', '/', '%')]= (in [expr])=0APreprocessor error=0A=0Aocamlc standard parser gives erroneo= us position, and just complains about "Syntax error", while camlp4 is able = to say precisely where the error occurred, and why (here because an express= ion is expected after the * infix operator). And this really makes the diff= erence for tricky syntax errors (or when learning =0Athe language - I wish = I had been taught of camlp4 back then ^^).=0A=0A=0AMatthieu Wipliez=0A=0A--= --- Message d'origine ----=0ADe : Yitzhak Mandelbaum =0A=C3=80 : caml-list =0AEnvoy=C3=A9 le : Mar= di, 11 D=C3=A9cembre 2007, 3h03mn 57s=0AObjet : Re: [Caml-list] Ask for a m= ore efficient way to deallocate memory (full version)=0A=0A=0A=0AOn Dec 10,= 2007, at 5:59 PM, Jon Harrop wrote:=0A=0A=0A=0A However, using any camlp4 = macros requires using the camlp4 replacement for the =0A front-end of the c= ompiler. That uses a different parsing technology (top-down =0A recursive d= escent LL rather than bottom-up LALR) so the error messages from =0A the co= mpiler are completely different.=0A =0A=0A=0AJust to clarify : the error me= ssages from the *parser* are completely different. Everything after the par= ser is the same with or without camlp4. Most importantly, you don't have to= learn new type-checker messages.=0A=0A=0AYitzhak=0A=0A -------------------= -------------------------------=0AYitzhak Mandelbaum=0AAT&T Labs - Research= =0A=0A=0Ahttp://www.research.att.com/~yitzhak=0A=0A =0A=0A=0A=0A=0A=0A=0A= =0A __________________________________________________________________= ___________ =0ANe gardez plus qu'une seule adresse mail ! Copiez vos mails = vers Yahoo! Mail http://mail.yahoo.fr --0-1240555290-1197367012=:54459 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Error messages do are different:

> cat syntax_error.ml
le= t f a b =3D
  a + b *

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

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

oc= amlc standard parser gives erroneous position, and just complains about "Sy= ntax error", while camlp4 is able to say precisely where the error occurred= , and why (here because an expression is expected after the * infix operato= r). 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>
=C3=80 : ca= ml-list <caml-list@yquem.inria.fr>
Envoy=C3=A9 le : Mardi, 11 D=C3= =A9cembre 2007, 3h03mn 57s
Objet : Re: [Caml-list] Ask for a more e= fficient way to deallocate memory (full version)

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


However, using an= y camlp4 macros requires using the camlp4 replacement for the 

= front-en= d of the compiler. That uses a different parsing technology (top-down 

r= ecursive descent LL rather than bottom-up LALR) so the error messages from<= span class=3D"Apple-converted-space"> 

the compiler are completely different.


Just to clarify : t= he error messages from the *parser* are completely different. Everything af= ter 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




=0A =0A=0A
=0ANe garde= z plus qu'une seule adresse mail ! Copiez vos ma= ils vers Yahoo! Mail --0-1240555290-1197367012=:54459--