caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Sachin Shah" <zakaluka@gmail.com>
To: "Oliver Bandel" <oliver@first.in-berlin.de>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Arg-module: Float-Args also accept integer values
Date: Tue, 8 Aug 2006 14:40:58 -0700	[thread overview]
Message-ID: <388f6fcd0608081440x3797a882o51e5288205581de0@mail.gmail.com> (raw)
In-Reply-To: <20060808213359.GA2364@first.in-berlin.de>

On 8/8/06, Oliver Bandel <oliver@first.in-berlin.de> wrote:
> On Tue, Aug 08, 2006 at 03:19:15PM -0600, William D. Neumann wrote:
> > On Tue, 8 Aug 2006, Oliver Bandel wrote:
> >
> > >Is this a wanted behaviour?
> > >It's an implicit conversion from the integer value in the cli-string
> > >to float. Even if this is very convenient for a user, it is not
> > >completely following OCaml's philosophy (regarding types).
> >
> > Not really.  It's the same behavior as float_of_string (because it uses
> > float of string).
> >
> > # float_of_string "42";;
> > - : float = 42.
> >
> [...]
>
> Ah, ok, I see.
>
> Thanks!
>
> (But.... shouldn't throw this an eception, because it's
>  an int, not a float?!)
>
> Ciao,
>    Oliver

No, because 42 is a valid int and a valid float.  Since integers are a
proper subset of floating-point numbers, this is the correct behavior
for float_of_string.

Regards,

Sachin.


  reply	other threads:[~2006-08-08 21:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-08 20:57 Oliver Bandel
2006-08-08 21:19 ` [Caml-list] " William D. Neumann
2006-08-08 21:33   ` Oliver Bandel
2006-08-08 21:40     ` Sachin Shah [this message]
2006-08-08 22:12       ` Oliver Bandel
2006-08-09  3:25         ` Jonathan Roewen
2006-08-09  3:30           ` Jonathan Roewen
2006-08-09  5:54           ` Oliver Bandel
2006-08-09  6:13             ` Jonathan Roewen

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=388f6fcd0608081440x3797a882o51e5288205581de0@mail.gmail.com \
    --to=zakaluka@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=oliver@first.in-berlin.de \
    /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).