The R Project SVN R

Rev

Rev 68948 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
42333 ripley 1
% File src/library/methods/man/LanguageClasses.Rd
68948 ripley 2
% Part of the R package, https://www.R-project.org
59039 ripley 3
% Copyright 1995-2008 R Core Team
42333 ripley 4
% Distributed under GPL 2 or later
5
 
19087 jmc 6
\name{language-class}
71767 maechler 7
\title{Classes to Represent Unevaluated Language Objects}
19087 jmc 8
\docType{class}
56186 murdoch 9
\alias{language-class}
19087 jmc 10
\alias{(-class}
11
\alias{<--class}
12
\alias{call-class}
13
\alias{for-class}
14
\alias{if-class}
15
\alias{repeat-class}
16
\alias{while-class}
17
\alias{name-class}
47307 ripley 18
\alias{\{-class}
19087 jmc 19
\description{  The virtual class \code{"language"} and the specific
20
  classes that extend it represent unevaluated objects, as produced for
21
  example by the parser or by functions such as \code{\link{quote}}.
22
}
23
\usage{
24
### each of these classes corresponds to an unevaluated object
44243 ripley 25
### in the S language.
26
### The class name can appear in method signatures,
19087 jmc 27
### and in a few other contexts (such as some calls to as()).
28
 
29
"("
30
"<-"
31
"call"
32
"for"
33
"if"
34
"repeat"
35
"while"
36
"name"
71767 maechler 37
"{"
19087 jmc 38
 
39
### Each of the classes above extends the virtual class
40
"language"
41
}
19089 jmc 42
\section{Objects from the Class}{
43
  \code{"language"} is a virtual class; no objects may be created from
19087 jmc 44
  it.
45
 
71767 maechler 46
  Objects from the other classes can be generated by a call to
47
  \code{new(Class, ...)}, where \code{Class} is the quoted class name, and
48
  the \dots arguments are either empty or a \emph{single} object that is
49
  from this class (or an extension).
50
}
19087 jmc 51
\section{Methods}{
52
  \describe{
53
    \item{coerce}{\code{signature(from = "ANY", to = "call")}.  A method
54
      exists for \code{as(object, "call")}, calling \code{as.call()}. }
55
  }
71767 maechler 56
}
57
\examples{
58
showClass("language")
19087 jmc 59
 
71767 maechler 60
is( quote(sin(x)) ) # "call"  "language"
61
 
62
(ff <- new("if"))  ; is(ff) # "if" "language"
63
(ff <- new("for")) ; is(ff) # "for" "language"
19087 jmc 64
}
65
\keyword{classes}