On Mar 29, 8:08 am, Meikel Brandmeyer <m...@kotka.de> wrote:
> Hi,
>
> Am 27.03.2009 um 09:25 schrieb Mark Engelberg:
>
>
>
> > I may come along and want to extend test-prefer to a type ::d which
> > derives from ::c and ::e, where ::e provides an alternative
> > implementation.
>
> > a        b                   (a and b are intended to be hidden from
> > end-user)
> > |         |
> > ----------
> >    |
> >    c          e
> >    |           |
> >    ------------
> >         |
> >         d
>
> > (derive ::d ::c)
> > (derive ::d ::e)
> > (defmethod test-prefer ::e [h] "e")
>
> > Now, as an external user, I know nothing about where test-prefer on
> > ::c gets its behavior.  Obviously, I have to disambiguate between
> > whether test-prefer chooses ::c over ::e, so I may try something like
> > this:
> > (prefer-method test-prefer ::c ::e)
>
> > But this will not work.  I still get an error saying I need to
> > disambiguate between ::a and ::e.  And not knowing anything about ::a,
> > I could be very confused, and not know how to provide this
> > information.
>
> Is there some special reason, why choosing ::c is not enough in
> prefer-method? As soon as I preferred ::c over ::e. Why should
> I then need to go further up the tree?
>

No, this was just a conservative decision on my part, but prefer-
method could prefer the path through ::c and not just ::c and its
descendants. I'm working on supporting this now.

Rich
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to