guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [goops] adding a number class with generic methods


From: Mikael Djurfeldt
Subject: Re: [goops] adding a number class with generic methods
Date: Tue, 9 May 2006 10:30:10 +0200

On 5/9/06, Ludovic Courtès <address@hidden> wrote:
"Mikael Djurfeldt" <address@hidden> writes:

> In the current module system, the effect of mentioning a variable in
> an export statement is to set up a new, undefined, variable with that
> name.

And thus the first `define-method' creates a new, empty, generic
function.  That makes it sometimes quite tricky to spread method
definitions all over the place (e.g., see G-Wrap...).

Could you elaborate on that?  In what way does GOOPS/module system
make this tricky, and how do you envision a better design?

It is my opinion that the current design with regards to generic
functions, methods and module system is in no way too restrictive.  If
you think it is, you should read the following reference:

 
http://www2.parc.com/csl/groups/sda/publications/papers/Kiczales-OOPSLA92/for-web.pdf

Rather, I think the points where it can be criticized is that some
things are a bit "too automatic" and there should be better and more
error messages in some cases.

If you want a certain generic function to be available everywhere,
then you have to pose exactly the same question as you would do for an
ordinary function: Which module should export this function? Everybody else needs to import from that module, even those who add
new methods.

Of course, one may feel that the fact that methods can "spread"
through the generic function in a rather arbitrary manner across
module borders is a problem.  For those who want a more restricted
access to methods, there is the possibility to use extended generics. This is explained in NEWS, I think.

Best regards,
M




reply via email to

[Prev in Thread] Current Thread [Next in Thread]