The identifier is defined by an argument (which we know nothing about at the moment)
The identifier is defined by a built-in value/constant
The identifier is defined by a built-in function
The identifier is defined by a constant (includes built-in constant)
The identifier is defined by a function (includes built-in function)
The identifier is defined by a parameter (which we know nothing about at the moment)
The identifier type is unknown
The identifier is defined by a variable (includes parameter and argument)
Each reference has exactly one reference type, stored as the respective number. However, when checking, we may want to allow for one of several types, allowing the combination of the respective bitmasks.
Having reference types is important as R separates a variable definition from a function when resolving an identifier. In
c <- 3; print(c(1, 2))
the call toc
works normally (as the vector constructor), while writingc <- function(...) ..1
overshadows the built-in and causesprint
to only output the first element.See