The R Project SVN R

Rev

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

Rev 24517 Rev 24536
Line 33... Line 33...
33
 
33
 
34
###-- Using Method Dispatch on "mode" etc :
34
###-- Using Method Dispatch on "mode" etc :
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
    cat("abc: Before dispatching; x has class `", class(x), "':", sep="")
39
    cat("abc: Before dispatching; x="); str(x)
39
    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