The R Project SVN R

Rev

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

Rev 42333 Rev 44751
Line 44... Line 44...
44
      subclass arguments.
44
      subclass arguments.
45
    }
45
    }
46
 
46
 
47
    \item{.Object = "traceable"}{
47
    \item{.Object = "traceable"}{
48
      Objects of a class that extends \code{traceable} are used to
48
      Objects of a class that extends \code{traceable} are used to
49
      implement debug tracing (see \link{traceable-class} and
49
      implement debug tracing (see class \linkS4class{traceable} and
50
      \code{\link{trace}}).
50
      \code{\link{trace}}).
51
 
51
 
52
      The \code{initialize} method for these classes takes special
52
      The \code{initialize} method for these classes takes special
53
      arguments \code{def, tracer, exit, at, print}.  The first of these
53
      arguments \code{def, tracer, exit, at, print}.  The first of these
54
      is the object to use as the original definition (e.g., a
54
      is the object to use as the original definition (e.g., a
Line 102... Line 102...
102
  default).  For example, suppose you want to define a method for your
102
  default).  For example, suppose you want to define a method for your
103
  class, with special argument \code{x}, but you also want users to be
103
  class, with special argument \code{x}, but you also want users to be
104
  able to set slots specifically.  If you want \code{x} to override the
104
  able to set slots specifically.  If you want \code{x} to override the
105
  slot information, the beginning of your method definition might look
105
  slot information, the beginning of your method definition might look
106
  something like this:
106
  something like this:
107
  
107
 
108
  \preformatted{
108
  \preformatted{
109
    function(.Object, x, ...) \{
109
    function(.Object, x, ...) \{
110
      Object <- callNextMethod(.Object, ...)
110
      Object <- callNextMethod(.Object, ...)
111
      if(!missing(x)) \{ # do something with x
111
      if(!missing(x)) \{ # do something with x
112
  }
112
  }