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 FAA09168; Wed, 4 Jun 2003 05:07:39 +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 FAA09107 for ; Wed, 4 Jun 2003 05:07:38 +0200 (MET DST) Received: from mail.eecs.harvard.edu (bowser.eecs.harvard.edu [140.247.60.24]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h5437bH21517 for ; Wed, 4 Jun 2003 05:07:37 +0200 (MET DST) Received: by mail.eecs.harvard.edu (Postfix, from userid 32018) id 0F9C554C49C; Tue, 3 Jun 2003 23:07:35 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.eecs.harvard.edu (Postfix) with ESMTP id 0D72954C48E for ; Tue, 3 Jun 2003 23:07:35 -0400 (EDT) Date: Tue, 3 Jun 2003 23:07:35 -0400 (EDT) From: Lex Stein To: caml-list@inria.fr Subject: [Caml-list] polymorphic methods in objects? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam: no; 0.00; stein:01 ocamlc:01 cmo:01 dummy:01 null:01 dump:01 polymorphic:01 compile:02 objects:02 unbound:02 unit:03 string:03 eecs:03 object:03 lex:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, Why can't objects have polymorphic methods ? I'm trying a compile and ocamlc gets upset because I have a method with an unbound type in its signature (see below for ocamlc error output). Must methods be type paramaterized through some kind of a template mechanism? This seems a bit limiting: the methods of an object would have their type signature fixed across the lifetime of an object. method dummy_init : 'a -> unit method dump : out_channel -> unit method init : unit -> unit method join : string -> unit method null : unit -> unit method resolv : string -> hmap option end The method dummy_init has type 'a -> unit where 'a is unbound make: *** [pastry.cmo] Error 2 Thanks, Lex --- Lex Stein http://www.eecs.harvard.edu/~stein/ Harvard Computer Science TEL: 617-495-5973 ------------------- 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