From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA19002 for caml-redistribution@pauillac.inria.fr; Wed, 8 Mar 2000 19:26:07 +0100 (MET) Resent-Message-Id: <200003081826.TAA19002@pauillac.inria.fr> 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 OAA23009 for ; Tue, 7 Mar 2000 14:12:50 +0100 (MET) Received: from enseeiht.enseeiht.fr (enseeiht.enseeiht.fr [147.127.18.144]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id OAA28780 for ; Tue, 7 Mar 2000 14:12:47 +0100 (MET) Received: from enseeiht.fr by enseeiht.enseeiht.fr; Tue, 7 Mar 2000 14:12:57 +0100 (MET) X-Url: http://www.enseeiht.fr Sender: David.Chemouil@enseeiht.fr Message-ID: <38C50056.9A272C81@enseeiht.fr> Date: Tue, 07 Mar 2000 14:12:54 +0100 From: David Chemouil Organization: ENSEEIHT - LIMA/IRIT/CNRS X-Mailer: Mozilla 4.7 [en] (X11; I; SunOS 5.6 sun4u) X-Accept-Language: fr, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: typing of a class Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Resent-From: weis@pauillac.inria.fr Resent-Date: Wed, 8 Mar 2000 19:26:07 +0100 Resent-To: caml-redistribution@pauillac.inria.fr Hi, I've been using the OO features of Caml these past days, and soon observed a behavior of the typing system that I don't understand. Here is a simplified version of my problem: # class a (arg : a -> b) = object(self) val ob = arg self end and b = object end;; The instance variable self cannot be accessed from the definition of another instance variable I don't understand why it is forbidden for an object to pass itself to another one (which is possible in Java or Eiffel for example). Could someone explain me? Or is there a paper talking about this? thanks, dc -- David Chemouil [mailto:chemouil@enseeiht.fr] [mobile: 06 84 16 26 65] Laboratoire d'informatique et de mathématiques appliquées (IRIT-INPT)