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 2D422BC69 for ; Fri, 30 Mar 2007 06:29:15 +0200 (CEST) Received: from ipmail02.adl2.internode.on.net (ipmail02.adl2.internode.on.net [203.16.214.141]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2U4TBu6006948 for ; Fri, 30 Mar 2007 06:29:12 +0200 Received: from ppp36-111.lns2.syd6.internode.on.net (HELO [192.168.1.201]) ([59.167.36.111]) by ipmail02.adl2.internode.on.net with ESMTP; 30 Mar 2007 13:53:55 +0930 X-IronPort-AV: i="4.14,350,1170595800"; d="scan'208"; a="104055551:sNHT4348174950" Subject: Re: [Caml-list] int_of_string bug From: skaller To: Yaron Minsky Cc: Brian Hurt , caml-list In-Reply-To: <891bd3390703291826k6002ef28i93bca9944cdbceee@mail.gmail.com> References: <891bd3390703290927o4e1c6bb5gf8f562fedbc70096@mail.gmail.com> <891bd3390703291826k6002ef28i93bca9944cdbceee@mail.gmail.com> Content-Type: text/plain Date: Fri, 30 Mar 2007 14:23:51 +1000 Message-Id: <1175228631.18890.4.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 460C9217.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bug:01 yaron:01 minsky:01 ocaml's:01 ledit:01 ocaml:01 sourceforge:01 wrote:01 wrote:01 integer:01 exception:01 caml-list:01 dev:01 int:01 int:01 On Thu, 2007-03-29 at 21:26 -0400, Yaron Minsky wrote: > On 3/29/07, Brian Hurt wrote: > > 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*. > > Not really all that consistent: > > # int_of_string "1073741824";; > - : int = -1073741824 > # int_of_string "1073741825";; > Exception: Failure "int_of_string". > # skaller@rosella:/work/felix/svn/felix/felix/trunk$ ledit ocaml Objective Caml version 3.10+dev25 (2007-03-26) # int_of_string "1073741824";; - : int = 1073741824 # int_of_string "1073741825";; - : int = 1073741825 -- John Skaller Felix, successor to C++: http://felix.sf.net