This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Trouble understanding define (!)
Marius Vollmer writes:
Eric Moore <moore@chem.cmu.edu> writes:
> This strikes me as a fundamental issue, that we need some *general*
> way to resolve namespace conflicts in modules, at least to the extent
> of some simple means of getting a reference to the object bound to a
> particular name in a particular module.
Yes, of course. We need renaming imports, for example. Your
suggestion of having the importer of modules be in control to a very
large extent sounds good.
Actually, merging of generic functions might turn out to be a often
wanted thing, and we might want to provide a convenient syntax to
request it. But I don't want this generic merging to happen _without_
this explicit request from the user.
I like Eric's arrangement very much. But perhaps we can satisfy
Mikael's desire as well - that some generic functions with common
names should be transparently merged without requiring an explicit
user request. We could do this by
- making the "merge" / "name conflict" handler a generic
- using a special metaclass for all the generic functions that should
be transparently merged, e.g.
(define-generic length #:metaclass <mergeable-length-generics>)
- writing a method for the name conflict handler that is specialized
to this metaclass, and which merges the generic functions.
Regards,
Neil