This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: stupid question Re: Some questions about GOOPS and CLOS in general
Ceri Storey <cez@nomorespam.freeserve.co.uk> writes:
> Could someone *please* give me a pointer to something that would
> explain about slots/accessors etc?
The following table may help:
GOOPS/CLOS "standard OO paradigm" C++
slot feature int x;
generic method polymorphic method object1.f object2.f
accessor mutator/informator object.set() object.get()
class class (more or less) class ...
meta-class meta-class n.a.
MOP introspection Java reflection API (in Java)
meta-class+generic template template
n.a. private features private int x;
n.a. feature renaming n.a.
multiple inherit. multiple inheritance probematic (see "feature renaming")
repeated inherit. repeated inheritance c.x -> A.x B.x -> C(AB).x (merge)
slot-ref/set! protected features "friend" declaration
GOOPS and CLOS are a little bit differend than the standard OO paradigm:
* no private slots available
* generics (generic methods) ("multi methods") dispatch
on the type of their parameters. But they do not belong
to one of them. (That's why all slots must be public).
* the definition of a class inserts several accessor methods
into the surrounding environment as a side effect.
* with slot-ref/set! you can (intentionally or not) break the
class boundary.
Jost