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=1.0 required=5.0 tests=AWL,SPF_NEUTRAL 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 2DCBCBC69 for ; Wed, 27 Jun 2007 06:46:00 +0200 (CEST) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.226]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5R4jxkL021351 for ; Wed, 27 Jun 2007 06:46:00 +0200 Received: by wx-out-0506.google.com with SMTP id h27so958wxd for ; Tue, 26 Jun 2007 21:45:59 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=FWE9pvnR0wXG9ZomTL878OJoi1lpU/c62rCHT2cv0KkRkpMAgrFDjZfr8iizpn/hy354229oNywJxL/aPnoDBwDnXu3nIe7MrOBwaT06DwMJ9Jv2HMRjUBcWK9AUtSbw8433o9Hj3c4uQwYOP4fK+dmp4Os7KsIG7UQgJltu2m8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=NuLn1/xaBGX3+bxcLPMPQXjE+ZH7GxOm8YR0LL7mHqHTHS9hbQHGNdvkn3iIYSW7FF5M/K56t4v9eKa2iyyVf40h3aa2HEpS7bBkdeLO0dcDWVKddIeShQ1h+cfpTUervqJVi6J7xl+9N8LgyH2sZnqADOOhwr6ZzW/OLki+ldU= Received: by 10.70.9.8 with SMTP id 8mr267390wxi.1182919559485; Tue, 26 Jun 2007 21:45:59 -0700 (PDT) Received: from ?192.168.1.73? ( [70.130.235.154]) by mx.google.com with ESMTP id 67sm9562159wra.2007.06.26.21.45.57 (version=SSLv3 cipher=RC4-MD5); Tue, 26 Jun 2007 21:45:58 -0700 (PDT) Message-ID: <4681EC0B.8070907@gmail.com> Date: Tue, 26 Jun 2007 23:48:11 -0500 From: Edgar Friendly User-Agent: Thunderbird 2.0.0.4 (X11/20070604) MIME-Version: 1.0 To: Jon Harrop , caml-list Subject: Re: [Caml-list] Float literals References: <46817245.4020305@gmail.com> <20070627063826.e6b3ddbd.mle+ocaml@mega-nerd.com> <200706270510.12792.jon@ffconsultancy.com> In-Reply-To: <200706270510.12792.jon@ffconsultancy.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-j-chkmail-Score: MSGID : 4681EB87.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 4681EB87.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; literals:01 edgar:98 wrote:01 wrote:01 caml-list:01 int:01 string:02 string:02 float:03 float:03 languages:03 permissive:03 guess:04 erik:04 programmer:07 Jon Harrop wrote: > On Tuesday 26 June 2007 21:38:26 Erik de Castro Lopo wrote: >> I do not find the second last case odd (all languages I have used >> consider that a float), but I do for the last one. > > Would you like: > > float_of_string "55378008" > > to work? > Yes, I would. Somehow there's a difference between user input and program code. For user input, you want to be pretty permissive in what you accept. I guess you could force the programmer to write try float_of_string str with Failure _ -> int_of_string str but there's all sorts of corner cases in that, from alternate bases to range issues. But technically it's a violation of spec, as the note (that I missed before) in the float-literal definition about requiring either an exponent or a decimal part of the number should apply here too.