The R Project SVN R

Rev

Rev 22949 | Rev 24536 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22949 Rev 24517
Line 35... Line 35...
35
## Tests S3 dispatch with the class attr forced to be data.class
35
## Tests S3 dispatch with the class attr forced to be data.class
36
## Not very relevant when S4 methods are around, but kept for historical interest
36
## Not very relevant when S4 methods are around, but kept for historical interest
37
abc <- function(x, ...) {
37
abc <- function(x, ...) {
38
    if (is.null(oldClass(x))) oldClass(x) <- data.class(x)
38
    if (is.null(oldClass(x))) oldClass(x) <- data.class(x)
39
    cat("abc: Before dispatching; x="); str(x)
39
    cat("abc: Before dispatching; x="); str(x)
40
    UseMethod("abc", x,...) ## UseMethod("abc") (as in S) fails
40
    UseMethod("abc", x) ## UseMethod("abc") (as in S) fails
41
}
41
}
42
 
42
 
43
abc.default <- function(x, ...) sys.call()
43
abc.default <- function(x, ...) sys.call()
44
 
44
 
45
"abc.(" <- function(x)
45
"abc.(" <- function(x)