tests/doubleEval.S

f <- function(x) {
     return(tmp <<- tmp + x)
}
typeInfo(f) <-
     SimultaneousTypeSpecification(
       TypedSignature( x="numeric" ),
       returnType = "numeric")


tmp <- 0
g =
function(x) {
  checkReturnValue(.val <- tmp <<- tmp + 1, return(.val), NULL)
  cat("still going\n")
}

attr(g, "TypeInfo") <- ReturnTypeSpecification("numeric")

Try the TypeInfo package in your browser

Any scripts or data that you put into this service are public.

TypeInfo documentation built on Nov. 8, 2020, 5:40 p.m.