From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 7D24CBC29 for ; Wed, 9 Aug 2006 07:54:24 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k795sO71032711 for ; Wed, 9 Aug 2006 07:54:24 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id HAA04788 for ; Wed, 9 Aug 2006 07:54:23 +0200 (MET DST) Received: from einhorn.in-berlin.de (einhorn.in-berlin.de [192.109.42.8]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k795sMoV032124 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 9 Aug 2006 07:54:23 +0200 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: Received: from first.in-berlin.de (e178062057.adsl.alicedsl.de [85.178.62.57]) (authenticated bits=0) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id k795sMrg026129 for ; Wed, 9 Aug 2006 07:54:22 +0200 Received: by first.in-berlin.de (Postfix, from userid 501) id B5B442F7D3B; Wed, 9 Aug 2006 07:54:36 +0200 (CEST) Date: Wed, 9 Aug 2006 07:54:36 +0200 From: Oliver Bandel To: caml-list@inria.fr Subject: Re: [Caml-list] Arg-module: Float-Args also accept integer values Message-ID: <20060809055436.GF4473@first.in-berlin.de> References: <20060808221224.GC3719@first.in-berlin.de> <78109874304-BeMail@beos> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <78109874304-BeMail@beos> User-Agent: Mutt/1.5.6i X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 X-Miltered: at nez-perce with ID 44D97890.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 44D9788E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; bandel:01 in-berlin:01 ocaml:01 val:01 ocaml:01 impl:01 libs:01 choosen:01 bug:01 ocaml's:01 notation:01 ocaml's:01 arises:01 interfacing:01 2006:98 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 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 = > > # 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