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 65... Line 65...
65
> ## Tests S3 dispatch with the class attr forced to be data.class
65
> ## Tests S3 dispatch with the class attr forced to be data.class
66
> ## Not very relevant when S4 methods are around, but kept for historical interest
66
> ## Not very relevant when S4 methods are around, but kept for historical interest
67
> abc <- function(x, ...) {
67
> abc <- function(x, ...) {
68
+     if (is.null(oldClass(x))) oldClass(x) <- data.class(x)
68
+     if (is.null(oldClass(x))) oldClass(x) <- data.class(x)
69
+     cat("abc: Before dispatching; x="); str(x)
69
+     cat("abc: Before dispatching; x="); str(x)
70
+     UseMethod("abc", x,...) ## UseMethod("abc") (as in S) fails
70
+     UseMethod("abc", x) ## UseMethod("abc") (as in S) fails
71
+ }
71
+ }
72
> 
72
> 
73
> abc.default <- function(x, ...) sys.call()
73
> abc.default <- function(x, ...) sys.call()
74
> 
74
> 
75
> "abc.(" <- function(x)
75
> "abc.(" <- function(x)