From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,SPF_SOFTFAIL autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 4EB7ABC69 for ; Sat, 29 Dec 2007 07:30:51 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAEx4dUdFEXUKnmdsb2JhbACQEgEBAQEHBAYHIpwF X-IronPort-AV: E=Sophos;i="4.24,219,1196636400"; d="scan'208";a="20766928" Received: from mail8.sea5.speakeasy.net ([69.17.117.10]) by mail4-smtp-sop.national.inria.fr with ESMTP; 29 Dec 2007 07:30:50 +0100 Received: (qmail 25735 invoked from network); 29 Dec 2007 06:30:48 -0000 Received: from shell2.sea5.speakeasy.net ([69.17.116.3]) (envelope-sender ) by mail8.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 29 Dec 2007 06:30:48 -0000 Date: Fri, 28 Dec 2007 22:30:48 -0800 (PST) From: brogoff To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] "OCaml gives you only monomorphic methods in classes." In-Reply-To: <200712282337.23952.jon@ffconsultancy.com> Message-ID: References: <200712282337.23952.jon@ffconsultancy.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam: no; 0.00; ocaml:01 milner:01 inference:01 ocaml:01 haskell:01 overloading:01 polymorphism:01 odersky:01 olabl:01 2007,:98 polymorphic:01 wrote:01 integer:01 incompatible:01 speakeasy:01 On Fri, 28 Dec 2007, Jon Harrop 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 What's the date that quote was made? It was probably made before polymorphic methods were added to OCaml from OLabl. > In what way must methods be monomorphic in OCaml classes? They don't need to be. See section 3.11 of "Objects in Caml" of the manual. -- Brian