caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Oliver Bandel <oliver@first.in-berlin.de>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Arg-module: Float-Args also accept integer values
Date: Wed, 9 Aug 2006 07:54:36 +0200	[thread overview]
Message-ID: <20060809055436.GF4473@first.in-berlin.de> (raw)
In-Reply-To: <78109874304-BeMail@beos>

On Tue, Aug 08, 2006 at 08:25:42PM -0700, Jonathan Roewen wrote:
> > ===========================================
> > first:~ oliver$ ocaml
> >         Objective Caml version 3.09.2
> > 
> > # let floatingpoint_id (x:float) = x;;
> > val floatingpoint_id : float -> float = <fun>
> > # floatingpoint_id 42;;
> > This expression has type int but is here used with type float
> > # 
> > ===========================================
> 
> float_of_string doesn't use the ocaml type system ;-) Don't know about 
> impl details, but it's basically like atof (or whatever it's called) in 
> standard C libs. The two are completely separate.

I don't care about the implementation-details here,
and both ways of converting would make sense, IMHO.
But I want to have clear why this atof-like way was choosen.
So, it's a  design-decision-question (and one that could
reference to a bug, if the OCaml's type-system way was,
what initially was intended, but not implemented (for some reason).


To use the notation of OCaml's type system also for the connection with
the outer world could be one first step to have a more consistent way
of type system.

The same situation arises with database interfaces. If one uses the typical
way of connecting to databayses (e.g. sending SQL-statements of any possible
SQL (if syntactically correct)) this means that the type system breaks at
the boundary from in- to outside of the program.

IMHO it could make sense to have a limited set of SQL-statements, but that
they provide a consistent way of OCaml's types to the outer world.

And this could also be done when interfacing via command line interface.


Ciao,
   Oliver


  parent reply	other threads:[~2006-08-09  5:54 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
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 [this message]
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=20060809055436.GF4473@first.in-berlin.de \
    --to=oliver@first.in-berlin.de \
    --cc=caml-list@inria.fr \
    /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).