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: Syntatic sugar and identifier permissivity


Craig Brozefsky <craig@red-bean.com> writes:
> > > The reason is that in Perl, a method is just a function scoped within
> > > a class 
> > 
> > even in CLOS a method is simply a message within a package scope.
> 
> I think your mistaking one possible use of generic functions as being
> the essence of them.

No.  But I see that I wrote "message" but meant "function". :)
GF are messages but methods are functions.


> There is quite a difference between Perl and CLOS on this matter.  In
> Perl, Packages and Classes are the same

That's another thing.  In any reasonable OO system classes (in the
sense you use the word) and packages are the same.  However, it is
important to group classes into a higher level construct.  In guile
this is the module, in Java it is called "package", in eiffel this
construct is implicit, in perl this construct is a directory.


> In CLOS, generic functions are named by a symbol which is in a
> Package.  Methods are attached to this generic function and are not
> limited to the scope of the package they are defined in.  So, unlike
> Perl, classes are not "simply packages", and methods are not scoped to
> classes at all. You can list all methods that specialize on a given
> class using the MOP, but this is done by going thru all of the generic
> functions and looking at their methods' specializers, not by looking
> at the scope of their name.

Yes.  The fact that the module to which a method belongs is not
visible at run time is a bug.  See Kiczales paper or our discussion on
this list: "no external overrides".


Jost

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