From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p4ABKAcf013793 for ; Tue, 10 May 2011 13:20:10 +0200 X-IronPort-AV: E=Sophos;i="4.64,345,1301868000"; d="scan'208";a="108008228" Received: from mp-57040.rocqadm.inria.fr ([128.93.57.40]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA; 10 May 2011 13:20:05 +0200 Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=iso-8859-1 From: xclerc In-Reply-To: <4DC7F736.6050807@gmail.com> Date: Tue, 10 May 2011 13:20:04 +0200 Cc: xclerc Clerc Message-Id: References: <4DC7F736.6050807@gmail.com> To: Caml List , bobzhang1988@gmail.com X-Mailer: Apple Mail (2.1084) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p4ABKAcf013793 Subject: Re: [Caml-list] two bugs in camlp4? Help!! Le 9 mai 2011 à 16:16, bob zhang a écrit : > Hi, all, > I am not sure that I made a mistake or two minor bugs in camlp4 revised > syntax? > > Both cases are in toploop, after I type > > #camlp4r;; > #load "camlp4rf.cma"; > Register.loaded_modules; > - : ref (list string) = > {Pervasives.contents= > ["Camlp4ListComprenhsion"; "Camlp4MacroParser"; "Camlp4MacroParser"; > "Camlp4GrammarParser"; "Camlp4OCamlRevisedParserParser"; > "Camlp4QuotationExpander"; "Camlp4OCamlRevisedParser"]} > > > case1: > for the signature parsing, > > when I type > value x ~num(num=3) y = num > 0 ; > --> value x: ~?num:int -> bool Under 3.12.x, "value x ~num(num=3) y = num > 0 ;" cannot be parsed. It is likely that what you want to write is "value x ?(num = 3) y = num > 0;". The printed signature is then "value x : ~?num:int -> 'a -> bool" which is bogus. It should be "value x : ?num:int -> 'a -> bool"; a fix has just been committed for inclusion in the upcoming 3.12.1. > case 2: > when I type > module X = struct type a = int and b = (int * int); end; > in the toploop > module X : sig type a = int; and b = (int * int); end > you can see the semi is redudant, it is an error? This is another bug in the toplevel printer for the revised grammar. Another fix has been committed. Thanks for reporting, Xavier Clerc