Displaying 1 result from an estimated 1 matches for "oldfoo".
Did you mean:
oldbox
2008 Sep 09
0
Defining an alias for a generic function and callNextMethod() strange behaviour
...hod("foo", "character", function(x, y=NA) unlist(callNextMethod()))
> foo(5)
[[1]]
[1] 5
[[2]]
[1] NA
> foo("a")
[1] "a" NA
And I want to define a temporary alias for foo() for backward
compatibility with some existing code:
oldfoo <- function(...) { .Deprecated("foo"); foo(...) }
> oldfoo(5)
[[1]]
[1] 5
[[2]]
[1] NA
Warning message:
'oldfoo' is deprecated.
Use 'foo' instead.
See help("Deprecated")
> oldfoo("a")
Error in .nextMethod()...