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 WAA18037; Wed, 6 Feb 2002 22:02:25 +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 WAA16174 for ; Wed, 6 Feb 2002 22:02:24 +0100 (MET) Received: from wetware.wetware.com (wetware.wetware.com [199.108.16.1]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g16L2MT17471; Wed, 6 Feb 2002 22:02:22 +0100 (MET) Received: from kallisti.apple.com(wetware.wetware.com[199.108.16.1]) (1976 bytes) by wetware.wetware.com via sendmail with P:esmtp/R:bind_hosts/T:inet_zone_bind_smtp (sender: ) id for ; Wed, 6 Feb 2002 13:02:21 -0800 (PST) (Smail-3.2.0.114 2001-Aug-6 #1 built 2002-Jan-4) Date: Wed, 6 Feb 2002 13:02:52 -0800 Subject: [Caml-list] integer types and their literals Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v480) Cc: The Trade To: Xavier Leroy From: james woodyatt In-Reply-To: <20020206190151.A9371@pauillac.inria.fr> Message-Id: Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.480) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wednesday, February 6, 2002, at 10:01 , Xavier Leroy wrote: > [...] We have three "big integer" types: > int32, nativeint and int64. A C-style syntax would be 12345L for > int32 and 123456789LL for int64; what about nativeint? 12345N ? > Anything nicer? Given my heritage as a Perl and C++ hacker, my opinion may be next to worthless here, so I will simply observe that this would be consistent with other choices already made, e.g. the syntax for representing integer literals in hexadecimal and octal. I think what you have proposed here would do very well. While we're on the subject: It would be nice to have conversion functions that raise exceptions to indicate overflow, i.e. converting 0x100000000LL to int32 could raise an exception of int32, where the value is 0L. Do you think such functions belong in the standard library, or should I expect to bolt them on later? Also, I deeply long for unsigned integer types. I'd be happy if the type system included them, and required explicit conversion between signed and unsigned integer values. Is there a reason Ocaml doesn't have unsigned integer types? -- j h woodyatt "...the antidote to misinformation is more information, not less." --vinton cerf ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr