[R-gregmisc-users] SF.net SVN: r-gregmisc: [1277] trunk/gtools/man
Brought to you by:
warnes
From: <wa...@us...> - 2008-05-22 16:17:00
|
Revision: 1277 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1277&view=rev Author: warnes Date: 2008-05-22 09:16:56 -0700 (Thu, 22 May 2008) Log Message: ----------- Rename assert-deprecated.R to assert.R to meet R file name requirements. Added Paths: ----------- trunk/gtools/man/assert.R Removed Paths: ------------- trunk/gtools/man/assert-deprecated.R Deleted: trunk/gtools/man/assert-deprecated.R =================================================================== --- trunk/gtools/man/assert-deprecated.R 2008-05-22 16:15:21 UTC (rev 1276) +++ trunk/gtools/man/assert-deprecated.R 2008-05-22 16:16:56 UTC (rev 1277) @@ -1,49 +0,0 @@ -\name{assert-deprecated} -\alias{assert-deprecated} -\alias{assert} -\title{DEPRECATED: Generate an error if an expression is not true.} -\description{ - Generate an error if an expression is not true. -} -\note{ - This function is deprecated in favor of \code{\link[base]{stopifnot}} -} -\usage{ -assert(FLAG) -} -\arguments{ - \item{FLAG}{ Expression that should evaluate to a boolean vector} -} -\details{ - Assert generate an error if its aregument does not evaluate to - boolean (vector) containing only \code{TRUE} values. This is useful - for defensinve programming as it provides a mechanism for checking - that certain facts, the 'assertions', do in fact hold. Checking of - 'assertions' is an important tool in the development of robust program - code. -} -\value{ - None. Evaluated only for its side effect. -} -\author{Gregory R. Warnes \email{wa...@bs...} } -\seealso{ - \code{\link[base]{stopifnot}}, \code{\link[base]{stop}}, - \code{\link[base]{warning}} -} -\examples{ - -## Trivial example -posSqrt <- function(x) - { - assert(x>=0) - sqrt(x) - } - -posSqrt(1:10) # works fine, no messages -\dontrun{ -posSqrt(-5:5) # generates an error, since the asssertion is not met -} - - -} -\keyword{programming} Copied: trunk/gtools/man/assert.R (from rev 1258, trunk/gtools/man/assert-deprecated.R) =================================================================== --- trunk/gtools/man/assert.R (rev 0) +++ trunk/gtools/man/assert.R 2008-05-22 16:16:56 UTC (rev 1277) @@ -0,0 +1,49 @@ +\name{assert-deprecated} +\alias{assert-deprecated} +\alias{assert} +\title{DEPRECATED: Generate an error if an expression is not true.} +\description{ + Generate an error if an expression is not true. +} +\note{ + This function is deprecated in favor of \code{\link[base]{stopifnot}} +} +\usage{ +assert(FLAG) +} +\arguments{ + \item{FLAG}{ Expression that should evaluate to a boolean vector} +} +\details{ + Assert generate an error if its aregument does not evaluate to + boolean (vector) containing only \code{TRUE} values. This is useful + for defensinve programming as it provides a mechanism for checking + that certain facts, the 'assertions', do in fact hold. Checking of + 'assertions' is an important tool in the development of robust program + code. +} +\value{ + None. Evaluated only for its side effect. +} +\author{Gregory R. Warnes \email{wa...@bs...} } +\seealso{ + \code{\link[base]{stopifnot}}, \code{\link[base]{stop}}, + \code{\link[base]{warning}} +} +\examples{ + +## Trivial example +posSqrt <- function(x) + { + assert(x>=0) + sqrt(x) + } + +posSqrt(1:10) # works fine, no messages +\dontrun{ +posSqrt(-5:5) # generates an error, since the asssertion is not met +} + + +} +\keyword{programming} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |