We avoid using the function forms for clarity, but they might actually be worse. Compare:
> "[" <- function(x, i, ...) vetr(numeric(), numeric())
> mean[1:5]
Error in mean[i = 1:5] :
For argument `x`, `mean` should be type "numeric" (is "closure")
To maybe:
Error in mean[i = 1:5] :
For argument `x`, `typeof(mean)` should be "numeric" (is "closure")
This is a particularly challenging case due to the nature of [. Also, we don't internally use typeof, but rather vetr::type_of which is not ideal for message.
We avoid using the function forms for clarity, but they might actually be worse. Compare:
To maybe:
This is a particularly challenging case due to the nature of
[
. Also, we don't internally usetypeof
, but rathervetr::type_of
which is not ideal for message.