From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA16120; Wed, 3 Sep 2003 11:57:21 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 LAA13033 for ; Wed, 3 Sep 2003 11:57:20 +0200 (MET DST) Received: from ep09.kernel.pl (ep09.kernel.pl [212.87.11.162]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h839vJf08259 for ; Wed, 3 Sep 2003 11:57:19 +0200 (MET DST) Received: (qmail 27381 invoked by uid 566); 3 Sep 2003 09:57:07 -0000 Date: Wed, 3 Sep 2003 11:56:12 +0200 From: Michal Moskal To: Jacques Garrigue Cc: c_bauer@informatik.uni-kl.de, caml-list@inria.fr Subject: Re: [Caml-list] Type inference + optional parameters Message-ID: <20030903095611.GA5564@roke.freak> Mail-Followup-To: Jacques Garrigue , c_bauer@informatik.uni-kl.de, caml-list@inria.fr References: <20030903110813O.garrigue@kurims.kyoto-u.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030903110813O.garrigue@kurims.kyoto-u.ac.jp> User-Agent: Mutt/1.4.1i X-PGP-Fingerprint: CF89 1B14 11BE 1CC9 2CA3 7497 5E32 69B4 BC71 B4C2 X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; michal:01 moskal:01 malekith:01 pld-linux:01 caml-list:01 inference:01 0900,:01 jacques:01 bauer:01 bauer:01 ocamls:01 inference:01 type-safe:01 michal:01 moskal:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Sep 03, 2003 at 11:08:13AM +0900, Jacques Garrigue wrote: > From: Christoph Bauer > > > ocamls type inference uses information of optionl arguments. This > > results in a strange behaviour. > > Brian Rogoff already answered this one. Do you seriously expect a > type-safe compiler to simply ignore the type of the default value :-) In principle you can imagine type system, where function have different type depending on whether it has default argument supplied. For example: do_with_conv : ~conv:('a -> 'b) -> 'a -> 'b [default conv: 'a -> 'a] or something like this. -- : Michal Moskal :: http://www.kernel.pl/~malekith : GCS {C,UL}++++$ a? !tv : When in doubt, use brute force. -- Ken Thompson : {E-,w}-- {b++,e}>+++ h ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners