Rev 27625 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{delay}\title{Delay Evaluation}\usage{delay(x, env=.GlobalEnv)}\alias{delay}\arguments{\item{x}{an expression.}\item{env}{an evaluation environment}}\description{\code{delay} creates a \emph{promise} to evaluate the givenexpression in the specified environment if its value is requested.This provides direct access to \emph{lazy evaluation} mechanismused by \R for the evaluation of (interpreted) functions.}\details{This is an experimental feature and its addition is purelyfor evaluation purposes.}\value{A \emph{promise} to evaluate the expression.The value which is returned by \code{delay} can be assignedwithout forcing its evaluation, but any further accesseswill cause evaluation.}\examples{x <- delay({for(i in 1:7)cat("yippee!\n")10})x^2 #- yippeex^2 #- simple number}\keyword{programming}\keyword{data}