This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Philosophy and object systems (was Re: goops/guile doc)
At 13:45 Uhr +0100 29.01.2000, Lalo Martins wrote:
> On Fri, Jan 28, 2000 at 09:01:48PM -0800, Craig Brozefsky wrote:
> > I would argue that they are the better solution, because they can
> > implement a message passing style, but are not strictly limited to
> > dispatching on one argument. With a simple macro I can use generic
> > functions to implement something that looks and acts just like java
> > methods (except it would have consistent runtime semantics and allow
> > you to specialize on more than one argument, including "this"). I can
> > also implement abstract protocols that are not tied to any class, yet
> > still have all of the advantages of full polmorphism.
>
> What are you talking about? C++ can do that. IIRC, ObjC can
> too. Actually, ISO C++ functions are _very_ similar to
> generics; even for not-class-bound functions, you can overload
> based on argument types.
The major and very significant difference is that in C++ generic
functions are "dispatched" at compile time.
> (So yes, C++ in its current form is a combination of
> message-passing and generics, and thus is possibly the ``best''
> sollution ;-)
I do actually like C++ and therefore probably dislike it being
misrepresented. Yes, standard C++ goes a long way toward parametric
parametric polymorphism. No, it does not do dynamic dispatching of
generic functions the way CLOS, Dylan, and GOOPS do.
Michael