caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Edgar Friendly <thelema314@gmail.com>
To: Jon Harrop <jon@ffconsultancy.com>, caml-list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Float literals
Date: Tue, 26 Jun 2007 23:48:11 -0500	[thread overview]
Message-ID: <4681EC0B.8070907@gmail.com> (raw)
In-Reply-To: <200706270510.12792.jon@ffconsultancy.com>

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.


  reply	other threads:[~2007-06-27  4:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-26 20:08 Edgar Friendly
2007-06-26 20:38 ` [Caml-list] " Erik de Castro Lopo
2007-06-27  4:10   ` Jon Harrop
2007-06-27  4:48     ` Edgar Friendly [this message]
2007-06-26 20:48 ` Robert Roessler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4681EC0B.8070907@gmail.com \
    --to=thelema314@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=jon@ffconsultancy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).