This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Trouble understanding define (!)


At 16:43 03/02/2000 -0500, Ken Anderson wrote:
>While i'm not completely up on your discussion, i can provide some CLOS
perspective.
>
>Kiczales' paper is definitely worth reading.  
>http://www.parc.xerox.com/csl/groups/sda/publications/papers/Kiczales-OOPSL
A92/

I read it a few days ago.  It is the kind of reading which helps the
programmer what is really involved in his everyday work (in my case with C++).

>I know several CLOS programmers, including myself who were suprised to
find out that 
>in Java or C++ instances of the same class can invoke private methods on
each other. 
> Is there a good reason for this besides convenience?

I suppose the idea is that private methods are implementation-specific (to
use Kiczales' terminology), so that code written by the implementor of the
class, and only that code, is allowed to call a private method in the same
class.  That person knows where the private method should or should not be
called on an instance or on another.  Code written for a sub-class of that
class cannot call the private method because the sub-class may be written
by someone who doesn't know when the private method should be used.

I don't know what could be the equivalent of private methods in Goops or
CLOS, since methods do not belong to classes.  On what basis would a method
be allowed to call another method or not ?  The only way I see is to define
it in a module and not to export it, so that it can be called within the
module only.  Maybe there are other ways, but I am familiar enough with
Goops, and I shouldn't even mention CLOS.

-- 
Thierry Bézecourt
bezecourt@globeid.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]