From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q18D9rbk027450 for ; Wed, 8 Feb 2012 14:09:54 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqsBACdzMk8machzl2dsb2JhbABDsAwBAQEBAQgWBzuBcgEBBThAARALGAkWDwkDAgECAUUGDQEHAQGIAbkui0sBBwIhBgELAQgFAwMJBQwCCQOCchkEAwwDFAWERQSoCg X-IronPort-AV: E=Sophos;i="4.73,383,1325458800"; d="scan'208";a="130576473" Received: from mx2.janestreet.com (HELO nyc-dmz-mxout2.janestreet.com) ([38.105.200.115]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 08 Feb 2012 14:09:53 +0100 Received: from nyc-qsv-mail1.delacy.com ([172.25.22.57]) by nyc-dmz-mxout2.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1Rv7HS-0003av-1U; Wed, 08 Feb 2012 08:09:50 -0500 Received: from ldn-qws-011.delacy.com ([172.23.133.111]) by nyc-qsv-mail1.delacy.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1Rv7HR-00042v-RO; Wed, 08 Feb 2012 08:09:49 -0500 Message-ID: <4F32741C.4040501@janestreet.com> Date: Wed, 08 Feb 2012 13:09:48 +0000 From: David House User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Gabriel Scherer CC: =?windows-1252?Q?Matej_Ko=9A=EDk?= <5764c029b688c1c0d24a2e97cd764f@gmail.com>, caml-list@inria.fr References: <4F326EA6.20900@gmail.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] syntactic detail On 02/08/2012 12:54 PM, Gabriel Scherer wrote: > There is no purpose, it's just an edge case of the simple lexical > specification you can find at: > http://caml.inria.fr/pub/docs/manual-ocaml/lex.html#float-literal > > Everywhere digits are allowed, you can insert extraneous underscores. > There is no restriction that there must be at least one digit for > underscores to be valid. I don't see why there should be. I would actually prefer a slightly more constrained format. It is very easy to typo large numbers like: let ten_million = 10_000_0000 in When eyeballing this, it is extremely easy to mistake this as 10^7, when it actual fact it is 10^8. I would prefer a syntax rule that only allows underscore every three characters (starting at the RHS of the number, i.e. complying to the usual convention). Well, certainly that for decimal literals. For hex literals you probably want to enforce the same, but every four characters.