Re: Can someone explain?

From: Jerome Vouillon (vouillon@pauillac.inria.fr)
Date: Tue Oct 05 1999 - 11:43:03 MET DST


Date: Tue, 5 Oct 1999 11:43:03 +0200
From: Jerome Vouillon <vouillon@pauillac.inria.fr>
To: skaller <skaller@maxtal.com.au>
Subject: Re: Can someone explain?
In-Reply-To: <37F930D0.6547CE0F@maxtal.com.au>; from skaller on Tue, Oct 05, 1999 at 08:57:20AM +1000

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



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:26 MET