# redefine funs to give us flexibility if we change packages without having

vetr:::match_call_alike(quote(var(y = 1:10, runif(10))), baseenv())

env0$var <- function(yollo, zambia) NULL

vetr:::match_call_alike(quote(var(y = 1:10, runif(10))), env0)

c5 <- quote(fun(a + b + a, FUN(z, a + 1)))

c6 <- quote(fun(x + y + x, FUN(w, x + 2)))

c7 <- quote(fun(x + y + x, FUN(w, y + 2)))

c8 <- quote(fun(x + y + x, FUN(w, x - 2)))

c9 <- quote(fun(x + y + x, FUN(w, x + "hello")))

$success
[1] TRUE

$message
NULL

$call.match
NULL

$call.ind
NULL

$call.ind.sub.par
NULL

$call.orig
NULL

$success
[1] FALSE

$message
$message$message
[1] "be"  "`x`" "is"  "`z`"

$message$wrap
$message$wrap[[1]]
NULL

$message$wrap[[2]]
NULL



$call.match
fun(x, y, z, "hello")

$call.ind
NULL[[4]]

$call.ind.sub.par
$call.ind.sub.par[[1]]
NULL

$call.ind.sub.par[[2]]
[1] 4


$call.orig
fun(x, y, z, "hello")

$success
[1] FALSE

$message
$message$message
[1] "be"              "a call to `fun`" "is"              "a call to `FUN`"

$message$wrap
$message$wrap[[1]]
NULL

$message$wrap[[2]]
NULL



$call.match
FUN(x, y, x, 1.01)

$call.ind
NULL[[1]]

$call.ind.sub.par
$call.ind.sub.par[[1]]
NULL

$call.ind.sub.par[[2]]
[1] 1


$call.orig
FUN(x, y, x, 1.01)

$success
[1] FALSE

$message
$message$message
[1] "be"         "\"double\"" "is"         "\"symbol\""

$message$wrap
$message$wrap[[1]]
NULL

$message$wrap[[2]]
NULL



$call.match
fun(x, y, x, z)

$call.ind
NULL[[5]]

$call.ind.sub.par
$call.ind.sub.par[[1]]
NULL

$call.ind.sub.par[[2]]
[1] 5


$call.orig
fun(x, y, x, z)

$success
[1] FALSE

$message
$message$message
[1] "be"  "`x`" "is"  "`y`"

$message$wrap
$message$wrap[[1]]
NULL

$message$wrap[[2]]
NULL



$call.match
fun(x + y + x, FUN(w, y + 2))

$call.ind
NULL[[3]][[3]][[2]]

$call.ind.sub.par
$call.ind.sub.par[[1]]
NULL

$call.ind.sub.par[[2]]
[1] 3


$call.orig
fun(x + y + x, FUN(w, y + 2))

$success
[1] FALSE

$message
$message$message
[1] "be"            "a call to `+`" "is"            "a call to `-`"

$message$wrap
$message$wrap[[1]]
NULL

$message$wrap[[2]]
NULL



$call.match
fun(x + y + x, FUN(w, x - 2))

$call.ind
NULL[[3]][[3]][[1]]

$call.ind.sub.par
$call.ind.sub.par[[1]]
NULL

$call.ind.sub.par[[2]]
[1] 3


$call.orig
fun(x + y + x, FUN(w, x - 2))