s-news
[Top] [All Lists]

Re: "Conflicting definitions"?

To: Duncan Murdoch <dmurdoch@pair.com>
Subject: Re: "Conflicting definitions"?
From: John Chambers <jmc@research.bell-labs.com>
Date: Thu, 24 Jul 2003 17:40:40 -0400
Cc: s-news@lists.biostat.wustl.edu
Organization: Bell Labs, Lucent Technologies
References: <frb0ivgkgkrdtjeh3qh79jpnh45m8eoudn@4ax.com>
Duncan Murdoch wrote:
> 
> I'm getting an error message that I don't understand.  Can anyone
> help?

Well, a warning message actually.

> 
> I have an abstract class called "orientation", with various
> descendants that can be instantiated.   I declare a "%*%" method for
> this class, because one way of looking at it is as a list of matrices.
> However, I get the following error message:
> 
> > setClass("orientation")
> > setMethod("%*%", c("orientation", "orientation"), function(x, y, ...)
> {
> }
> )
> redefining function "%*%" to be a generic function on database
> "F:\Program
>         files\Insightful\splus61\users\murdoch"
> Warning messages:
>   Conflicting definitions of "%*%" on databases "F:\Program
>         files\Insightful\splus61\users\murdoch" and  "splus" in:
> assign(f,
>         what@genericDef, where = where)
> 
> (I left the body of the method definition out, to make this post
> shorter.)
> 
> What does the "conflicting definitions" warning mean?  How should I do
> things differently to get rid of it?

It's just saying there are versions of the same function object on two
databases in your search list.  You could reasonably reply, "Of
course!"; in any event the message is probably ignorable.

The reason you see it for "%*%" and not, e.g., for "[" is that the
former is not a generic function until you create the method, so a
generic function version must be created (in your working data), which
triggers the warning.  For "[", the version in "main" is already a
generic, so no new version of the function is created:

S+> isGeneric("%*%")
[1] F
S+> isGeneric("[")
[1] T
S+> find("[")
[1] "main"

Anyway, the warning message is well-intended and could be important if
someone accidentally masked a function from one of the main libraries,
but in your case it's irrelevant.

John

-- 
John M. Chambers                  jmc@bell-labs.com
Bell Labs, Lucent Technologies    office: (908)582-2681
700 Mountain Avenue, Room 2C-282  fax:    (908)582-3340
Murray Hill, NJ  07974            web: http://www.cs.bell-labs.com/~jmc

<Prev in Thread] Current Thread [Next in Thread>