Version française
Home     About     Download     Resources     Contact us    
Browse thread
"OCaml gives you only monomorphic methods in classes."
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Gordon Henriksen <gordonhenriksen@m...>
Subject: Re: [Caml-list] "OCaml gives you only monomorphic methods in classes."
Jon, consider the case of Java or C++ method (and function)  
overloading. This form of static dispatch is quite distinct from  
virtual method dispatch, and is indeed at odds with type inference.

- Gordon

On Dec 28, 2007, at 16:37, Jon Harrop <jon@ffconsultancy.com> wrote:

>
> I just read this quote and I do not understand what it means:
>
>  "In particular, the Hindley/Milner style of type inference used in  
> languages
> such as OCaml or Haskell is incompatible with lots of assumptions of  
> OO
> languages. One incompatibility is with overloading. That's why OCaml  
> does not
> let you write + for both integer and floating point addition. Another
> incompatibility is with higher order polymorphism. That's why OCaml  
> gives you
> only monomorphic methods in classes." - Martin Odersky
>
> In what way must methods be monomorphic in OCaml classes?
>
> -- 
> Dr Jon D Harrop, Flying Frog Consultancy Ltd.
> http://www.ffconsultancy.com/products/?e
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs