From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id VAA28417 for caml-redistribution; Tue, 5 Oct 1999 21:50:22 +0200 (MET DST) Received: (from vouillon@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA30393 for caml-list@pauillac.inria.fr; Tue, 5 Oct 1999 11:43:42 +0200 (MET DST) Resent-Message-Id: <199910050943.LAA30393@pauillac.inria.fr> Received: (from vouillon@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA11928; Tue, 5 Oct 1999 11:43:03 +0200 (MET DST) Message-ID: <19991005114303.55235@pauillac.inria.fr> Date: Tue, 5 Oct 1999 11:43:03 +0200 From: Jerome Vouillon To: skaller Subject: Re: Can someone explain? References: <199910040823.KAA21438@pauillac.inria.fr> <37F930D0.6547CE0F@maxtal.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 0.89.1 In-Reply-To: <37F930D0.6547CE0F@maxtal.com.au>; from skaller on Tue, Oct 05, 1999 at 08:57:20AM +1000 Resent-From: vouillon@pauillac.inria.fr Resent-Date: Tue, 5 Oct 1999 11:43:42 +0200 Resent-To: caml-list@pauillac.inria.fr Sender: weis On Tue, Oct 05, 1999 at 08:57:20AM +1000, skaller wrote: > Pierre Weis wrote: > > > > > Is there a way to access a value of a class instance? > > > If so, what is the syntax? If not, what is the purpose > > > of allowing 'val' bindings in class declarations in module > > > signatures? > > > > The only way to access a value of a class instance is via method > > invocation: you have to define a method that returns the value. > > Thanks, but you have not answered the real question here: > WHY are the values present in the interface when they are not accessible > via the interface? > > > > Similarly, what is the purpose of allowing 'virtual' > > > methods in class types and class declarations in > > > module signatures? > > > > Virtual methods are methods that are declared but not implemented: > > sub-classes must define them. > > Again, I knew that, the real question is WHY this information > is in the _interface_?? This information is in the interface because a class declaration can also be used for inheritance, and a subclass can access the instance variables of its parent and provide an implementation for the virtual methods. -- Jérôme