Browse thread
[Caml-list] Type inference + optional parameters
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Michal Moskal <malekith@p...> |
| Subject: | Re: [Caml-list] Type inference + optional parameters |
On Wed, Sep 03, 2003 at 11:08:13AM +0900, Jacques Garrigue wrote:
> From: Christoph Bauer <c_bauer@informatik.uni-kl.de>
>
> > 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