From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id BAA24314; Fri, 15 Nov 2002 01:12:28 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id BAA24313 for ; Fri, 15 Nov 2002 01:12:27 +0100 (MET) Received: from speakeasy.org (dsl081-017-141.sea1.dsl.speakeasy.net [64.81.17.141]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id gAF0CQ115299 for ; Fri, 15 Nov 2002 01:12:26 +0100 (MET) Received: (from shawnw@localhost) by speakeasy.org (8.10.1/8.10.1) id gAF0Eq900627 for caml-list@inria.fr; Thu, 14 Nov 2002 16:14:52 -0800 Date: Thu, 14 Nov 2002 16:14:52 -0800 From: Shawn Wagner To: caml-list@inria.fr Subject: Re: [Caml-list] int32/int64 literals in next release? Message-ID: <20021114161452.D23757@speakeasy.org> Mail-Followup-To: caml-list@inria.fr References: <200211132203.gADM3nN14766@plinky.bolt-action.com> <200211132142.WAA19709@pauillac.inria.fr> <20021113234425.C23757@speakeasy.org> <20021114084943.GB13242@rashko> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20021114084943.GB13242@rashko>; from yrashk@openeas.org on Thu, Nov 14, 2002 at 10:49:43AM +0200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, Nov 14, 2002 at 10:49:43AM +0200, Yurii A. Rashkovskii wrote: > Hi Shawn! > > On Wed, 13 Nov 2002, Shawn Wagner wrote: > > Problems I know about already: > > [...] > > > Help with any of the above is appreciated. > > May be something like this will be easier? > > > open Pcaml;; > > let create_int loc v = <:expr< (int_of_string $str:v$) >>;; > let create_int32 loc v = <:expr< (Int32.of_string $str:v$) >>;; > let create_int64 loc v = <:expr< (Int64.of_string $str:v$) >>;; > let create_nativeint loc v = <:expr< (Nativeint.of_string $str:v$) >>;; > > EXTEND > > expr: > [[ > i = INT; "l" -> create_int32 loc i > | i = INT; "L" -> create_int64 loc i > | i = INT; "n" -> create_nativeint loc i > | i = INT -> create_int loc i > ]]; > > END > ; > I'd rather not have to go to the trouble of running every .ml file through camlp4 for something that the language should be able to handle by default without resorting to special tricks. Using camlp4 also kind of defeats the idea of not having to use a conversion function everywhere you'd want to use a literal large int value, doesn't it? Anyways, I /think/ I can get camlp4 at least compiled, if I can figure out where the constraints in an <:expr< > pattern are checked, and then how to add more. Trying to make it recognize $int32:_$ and the like. -- Shawn Wagner shawnw@speakeasy.org ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners