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=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 22C68BC69 for ; Fri, 30 Mar 2007 03:08:36 +0200 (CEST) Received: from bsd4.nyct.net (mail-out4.nyct.net [216.139.141.4]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2U18Y0K009690 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 30 Mar 2007 03:08:35 +0200 Received: from [216.139.138.21] ([216.139.138.21]) by bsd4.nyct.net (8.13.4/8.13.4) with ESMTP id l2U18MsN025986; Thu, 29 Mar 2007 21:08:25 -0400 (EDT) (envelope-from bhurt@spnz.org) Date: Thu, 29 Mar 2007 21:21:40 -0400 (EDT) From: Brian Hurt X-X-Sender: bhurt@localhost To: Yaron Minsky Cc: caml-list Subject: Re: [Caml-list] int_of_string bug In-Reply-To: <891bd3390703290927o4e1c6bb5gf8f562fedbc70096@mail.gmail.com> Message-ID: References: <891bd3390703290927o4e1c6bb5gf8f562fedbc70096@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at discorde with ID 460C6312.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bug:01 yaron:01 minsky:01 bug:01 ocaml:01 ocaml's:01 2007,:98 wrote:01 integer:01 caml-list:01 int:01 int:01 argument:02 caml:02 string:02 On Thu, 29 Mar 2007, Yaron Minsky wrote: > So, there's a weird int_of_string bug where positive decimal numbers are > sometimes read in as negative numbers without error. Here's the bug: > > http://caml.inria.fr/mantis/view.php?id=0004210 I'm actually not sure this is a bug either. Note that ocaml will quite happily compute max_int+1 without an error either. Wether this behavior (silent wrap around) is correct or not is another argument. Elsewhere I have opinioned that the only purpose for having more than one type of integer in your programming language is so that programmers can pick the wrong one. But I'm widely known to be a heretic. Ocaml's behavior is, at least, *consistent*. Brian