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 SAA02080; Thu, 23 Aug 2001 18:27:30 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA02174 for ; Thu, 23 Aug 2001 18:27:29 +0200 (MET DST) Received: from alan-schm1p.inria.fr ([217.11.170.207]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f7NGRSX02406 for ; Thu, 23 Aug 2001 18:27:28 +0200 (MET DST) Received: by alan-schm1p.inria.fr (Postfix, from userid 11207) id ABB6B23610; Thu, 23 Aug 2001 18:24:58 +0200 (CEST) Date: Thu, 23 Aug 2001 18:24:58 +0200 From: Alan Schmitt To: Paul Stodghill Cc: caml-list@inria.fr Subject: Re: [Caml-list] Duplicate methods - bug or feature? Message-ID: <20010823182458.G1841@alan-schm1p> Mail-Followup-To: Paul Stodghill , caml-list@inria.fr References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: =?iso-8859-1?Q?=3Cyz1pu9m92jw=2Efsf=40milhouse=2Ecs=2Ecornell=2Eedu=3E?= =?iso-8859-1?Q?=3B_from_stodghil=40cs=2Ecornell=2Eedu_on_jeu=2C_ao=FB_23?= =?iso-8859-1?Q?=2C_2001_at_12:14:11_-0400?= X-Editor: Vim http://vim.sf.net/ X-Info: http://pauillac.inria.fr/~aschmitt/ X-Operating-System: Linux/2.4.7 (i686) X-Uptime: 6:21pm up 16:38, 1 user, load average: 0.01, 0.03, 0.10 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk You might consider it a feature, due to multiple inheritance. IIRC, when a class inherits from two classes which define the same method name, the last one wins. Alan Schmitt * Paul Stodghill (stodghil@cs.cornell.edu) wrote: > Is it a bug or feature that a class can contain two methods with the > same name? Thanks. > > milhouse$ uname -a > CYGWIN_NT-5.0 MILHOUSE 1.3.2(0.39/3/2) 2001-05-20 23:28 i686 unknown > milhouse$ ocamlc -v > The Objective Caml compiler, version 3.02 > Standard library directory: /usr/local/lib/ocaml > milhouse$ > milhouse$ > milhouse$ cat double_method.ml > class a = > object > method m = "a.m1" > method m = "a.m2" > end > ;; > > let _ = > let x = new a in > Printf.printf "x=%s\n" x#m; > () > ;; > > milhouse$ > milhouse$ > milhouse$ ocamlc -o double_method.exe double_method.ml > milhouse$ ./double_method.exe > x=a.m2 > milhouse$ > > ------------------- > Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ > To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr -- The hacker: someone who figured things out and made something cool happen. ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr