is_robust_match: Recursively expand both the correct expression and the user's...

Description Usage Arguments Value Examples

View source: R/rmatch_calls.R

Description

Recursively expand both the correct expression and the user's expression and test for a match. CAUTION: May raise errors, as in rmatch_calls.

Usage

1
is_robust_match(expr1, expr2, eval_for_class, eval_env = NULL)

Arguments

expr1

expression

expr2

expression

eval_for_class

TRUE or FALSE. If TRUE, evaluate the first argument of an S3 method to determine its class. Default=FALSE.

eval_env

parent environment for evaluations to determine class. Ignored if eval_for_class=FALSE

Value

TRUE or FALSE according to whether expanded expressions match.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
  
  expr1 <- quote(print(paste("my_name_is", "mud")))
  expr2 <- quote(print(paste("my_name_is", "mud", sep=" ")))
  err <- try(ans <- is_robust_match(expr1, expr2, eval_for_class=TRUE), silent=TRUE)
  if(is(ans, "try-error")){
    ans <- isTRUE(all.equal())
  }

## End(Not run)

swirldev/swirl documentation built on Jan. 17, 2020, 6:28 p.m.