The R Project SVN R

Rev

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

Rev 70613 Rev 71377
Line 3... Line 3...
3
% Copyright 1995-2016 R Core Team
3
% Copyright 1995-2016 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{withVisible}
6
\name{withVisible}
7
\alias{withVisible}
7
\alias{withVisible}
8
\title{Return both a value and its visibility}
8
\title{Return both a Value and its Visibility}
9
\description{
9
\description{
10
This function evaluates an expression, returning it in a two element list
10
This function evaluates an expression, returning it in a two element list
11
containing its value and a flag showing whether it would automatically print.
11
containing its value and a flag showing whether it would automatically print.
12
}
12
}
13
\usage{
13
\usage{
14
withVisible(x)
14
withVisible(x)
15
}
15
}
16
\arguments{
16
\arguments{
17
  \item{x}{ An expression to be evaluated. }
17
  \item{x}{an expression to be evaluated.}
18
}
18
}
19
\details{
19
\details{
20
  The argument is evaluated in the caller's context.
20
  The argument, \emph{not} an \code{\link{expression}} object, rather
-
 
21
  an (unevaluated function) \code{\link{call}}, is evaluated in the
-
 
22
  caller's context.
21
 
23
 
22
  This is a \link{primitive} function.
24
  This is a \link{primitive} function.
23
}
25
}
24
\value{
26
\value{
25
  \item{value }{The value of \code{x} after evaluation.}
27
  \item{value }{The value of \code{x} after evaluation.}
26
  \item{visible }{logical; whether the value would auto-print.}
28
  \item{visible }{logical; whether the value would auto-print.}
27
}
29
}
28
\seealso{\code{\link{invisible}}, \code{\link{eval}}}
30
\seealso{\code{\link{invisible}}, \code{\link{eval}};
-
 
31
  \code{\link{withAutoprint}()} calls \code{\link{source}()} which
-
 
32
  itself uses \code{withVisible()} in order to correctly
-
 
33
  \dQuote{auto print}.
-
 
34
}
29
\examples{
35
\examples{
30
x <- 1
36
x <- 1
31
withVisible(x <- 1) # *$visible is FALSE
37
withVisible(x <- 1) # *$visible is FALSE
32
x
38
x
33
withVisible(x)      # *$visible is TRUE
39
withVisible(x)      # *$visible is TRUE