From ellis at stat.harvard.edu  Tue Dec 12 00:55:42 2006
From: ellis at stat.harvard.edu (Byron Ellis)
Date: Mon, 11 Dec 2006 15:55:42 -0800
Subject: [Rd] Wondering about methods (selecting a less specialized
	method)
In-Reply-To: <m2vekicb2x.fsf@ziti.local>
References: <7098abec0612111155lc493c2fj93cd48bad735b7df@mail.gmail.com>
	<m2vekicb2x.fsf@ziti.local>
Message-ID: <7098abec0612111555w3e4edb26l2d3554765c09cff9@mail.gmail.com>

Yup, that does it---I knew there was something but couldn't remember
what it was :-)

On 12/11/06, Seth Falcon <sfalcon at fhcrc.org> wrote:
> "Byron Ellis" <ellis at stat.harvard.edu> writes:
>
> > Hi All,
> >
> > I find myself wondering if there is a canonical means of achieving the
> > multiple-dispatch version of 'super'? Specifically, I have a set of
> > classes
> >
> > A, B, X and Y where B extends A
> >
> > and a method Foo with the signature (X,A,Y) and I'd like to implement
> > Foo with the signature (X,B,Y) such that it calls Foo_(X,A,Y) and then
> > does "other stuff." This gets a bit complicated with multiple
> > inheritance but at the moment the best I can think to do is an
> > explicit call to selectMethod.
>
> I would expect callNextMethod to work in most cases.  Have you tried
> that?
>
> setMethod("Foo", c("X", "B", "Y"),
>           function(x, b, y) {
>               ans <- callNextMethod()
>               ## more
>           })
>
> + seth
>
>


-- 
Byron Ellis (byron.ellis at gmail.com)
"Oook" -- The Librarian



[Rd] Wondering about methods (selecting a less specialized method)
Byron Ellis