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.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 61D49BC0A for ; Wed, 13 Jun 2007 13:40:50 +0200 (CEST) Received: from furbychan.cocan.org (furbychan.cocan.org [80.68.91.176]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5DBemJA032467 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 13 Jun 2007 13:40:50 +0200 Received: from rich by furbychan.cocan.org with local (Exim 3.35 #1 (Debian)) id 1HyRDT-0004ST-00 for ; Wed, 13 Jun 2007 12:40:47 +0100 Date: Wed, 13 Jun 2007 12:40:47 +0100 To: caml-list@inria.fr Subject: camlp4 3.10 and ints Message-ID: <20070613114043.GA14594@furbychan.cocan.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i From: Richard Jones X-Miltered: at concorde with ID 466FD7C0.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 camlp:01 integers:01 integers:01 syntax:01 ocamlc:01 -pp:01 cmo:01 mlast:01 cmo:01 ocamlc:01 -pp:01 compile:01 integer:01 integer:01 I'm getting some odd errors with camlp4 (3.10) and integers. Firstly, INT returns a string, rather than an int, and similarly $int:...$ expects a string instead of an int. I can live with this, but it seems a bit strange, and unless I'm mistaken is different from what camlp4 <= 3.09 did. Secondly, I get the error 'Failure: "Integer literal exceeds the range of representable integers of type int"' if I try to pass a string containing any int32 or int64 literal, eg. $int:"0x3ffL"$, even ones which obviously do not exceed the range of representable integers. To demonstrate this second one, save the following to files: -------------------------------------------------- pa_test.ml --- open Camlp4.PreCast open Syntax let expand_test _loc () = <:str_item< value test = $int:"0x3ffL"$ >> EXTEND Gram GLOBAL: str_item; str_item: LEVEL "top" [ [ "TEST" -> expand_test _loc () ] ]; END;; -------------------------------------------------- -------------------------------------------------- test.ml --- TEST -------------------------------------------------- And then compile with: $ ocamlc -pp "camlp4o pa_extend.cmo q_MLast.cmo" -I +camlp4 -c pa_test.ml $ ocamlc -pp "camlp4o ./pa_test.cmo" test.ml File "test.ml", line 1, characters 0-4: Failure: "Integer literal exceeds the range of representable integers of type int" Preprocessor error Are these bugs or am I missing something? Rich. -- Richard Jones Red Hat