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 IAA29790; Thu, 14 Nov 2002 08:42:07 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA29765 for ; Thu, 14 Nov 2002 08:42:06 +0100 (MET) Received: from speakeasy.org (dsl081-017-141.sea1.dsl.speakeasy.net [64.81.17.141]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id gAE7g4X17068 for ; Thu, 14 Nov 2002 08:42:05 +0100 (MET) Received: (from shawnw@localhost) by speakeasy.org (8.10.1/8.10.1) id gAE7iPL25309 for caml-list@inria.fr; Wed, 13 Nov 2002 23:44:25 -0800 Date: Wed, 13 Nov 2002 23:44:25 -0800 From: Shawn Wagner To: caml-list@inria.fr Subject: Re: [Caml-list] int32/int64 literals in next release? Message-ID: <20021113234425.C23757@speakeasy.org> Mail-Followup-To: caml-list@inria.fr References: <200211132203.gADM3nN14766@plinky.bolt-action.com> <200211132142.WAA19709@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200211132142.WAA19709@pauillac.inria.fr>; from pierre.weis@inria.fr on Wed, Nov 13, 2002 at 10:42:36PM +0100 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Nov 13, 2002 at 10:42:36PM +0100, Pierre Weis wrote: > Hi, > > > Is there any chance some way of inputing int32/int64 literals can be > > added to the compiler for this next release? > > AFAIK, this is fairly hight in the todo list. > Ask, and ye shall recieve (In other words, I had a few hours to kill and have been wanting this feature myself). http://raevnos.pennmush.org/code/litint306-1.diff.gz or http://raevnos.pennmush.org/code/ocaml.html in case the direct URL doesn't work, as I might put up newer versions (-2, -3, etc.) if I fix any of the problems noted below. Uses a suffix to the number to indicate type, like in C. The actual suffixes are taken from the printf formats. With it: % ./ocaml Objective Caml version 3.06 # 0;; - : int = 0 # 0l;; - : int32 = # 0L;; - : int64 = # 0n;; - : nativeint = # Int32.mul 6l 7l;; - : int32 = Tested with bytecode and i386 linux native. Problems I know about already: * The native compiler doesn't support literal int64's, as I didn't see a place to crib from for what to emit in cmmgen.ml after a quick look. * int32's and nativeints on the native compiler aren't heavily tested, though simple problems using them compile and appear to work right. * Compiling camlp4 breaks with: ../../boot/ocamlrun ../boot/camlp4 -nolib -I ../boot ./pa_lispr.cmo pa_extend.cmo q_MLast.cmo pr_dump.cmo -o pa_lisp.ppo pa_lisp.ml Error while loading "./pa_lispr.cmo": interface mismatch on MLast. I haven't been able to figure out why. camlp4 is commented out of the Makefile for now. * The Foo.of_string functions aren't handling the suffixes, even though I changed ints.c:parse_long() and ints.c:int64_of_string() to do so, and they work when called through gdb. Do ocamlrun and the native compiler use another set of functions for the conversions? Help with any of the above is appreciated. -- 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