guile-devel
[Top][All Lists]
Advanced

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

Re: Help required with exporting and using GOOP generics


From: Mark H Weaver
Subject: Re: Help required with exporting and using GOOP generics
Date: Fri, 15 Mar 2013 17:05:06 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Mark H Weaver <address@hidden> wrote:
> The proper solution is as follows:
>
> * Every generic function must be defined (using 'define-generic') and
>   exported from one (and only one) module.
>
> * Every module that uses a generic function, or adds a method to it (and
>   that includes slot accessors), must first import the generic function
>   from the (one) module that exports it.
>
> Think of a generic function as a normal procedure that contains an
> internal table of methods.  Like any other procedure, there's a single
> module that defines it and exports it.  The fact that some modules add
> methods to these internal tables does not mean that it is appropriate to
> export the procedure from those other modules.

Brent Pinkney <address@hidden> wrote:
> How does that work in an environment where you are using third party
> libraries, lice srfi, ice-9, guile-lib, etc as well as your own code.

I'm sorry, I don't understand what you mean here.

> How could one possibly ensure that the other libraries export say
> "format" correctly - perhaps they are purists and not even aware of
> the goops modules.

'format' is not a generic function.  What does that have to do with this
discussion?

> I think guile has it backwards here - goops must not break quiles
> modules when someone imports a guile generic.

Again, I don't understand.  What do you mean by "break guile's modules"?
Can you please elaborate?

    Thanks,
     Mark



reply via email to

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