The R Project SVN R

Rev

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

Rev 52110 Rev 58136
Line 8... Line 8...
8
      replace = function(from, value)
8
      replace = function(from, value)
9
      stop("meaningless to replace the \"maybe\" part of an object"))
9
      stop("meaningless to replace the \"maybe\" part of an object"))
10
 
10
 
11
aa <- new("A", x=1)
11
aa <- new("A", x=1)
12
 
12
 
13
ff <- function(x)"default ff"
13
setGeneric("ff", function(x)"default ff")
-
 
14
## test that the setGeneric() call created the generic & default
14
setGeneric("ff")
15
stopifnot(is(ff, "standardGeneric"),
-
 
16
          identical(body(getMethod("ff","ANY")), "default ff"))
15
 
17
 
16
ffMaybe <- function(x) "ff maybe method"
18
ffMaybe <- function(x) "ff maybe method"
17
setMethod("ff", "maybe", ffMaybe)
19
setMethod("ff", "maybe", ffMaybe)
18
 
20
 
19
aa2 <- new("A", x = -1) # condition not TRUE
21
aa2 <- new("A", x = -1) # condition not TRUE