Message-ID: <14795e98-d12d-9cc8-f55e-8c232ac53734@gmail.com>
Date: 2016-06-28T19:17:23Z
From: Duncan Murdoch
Subject: [R-pkg-devel] Absent variables and tibble
In-Reply-To: <91c23933-3732-19e0-5bef-c49d294e3423@gmail.com>
On 28/06/2016 1:15 PM, Duncan Murdoch wrote:
> I've now added a simple implementation of hasName to R-devel and
> R-patched. When I find the time, I'll go through the base packages and
> change the !is.null(x$name) idiom to hasName. (All but "base", that
> is: hasName is in utils, and it is better if base remains self-contained.)
After looking at a few cases, I don't think I'll do that. Often the
test is used to find out if x$name will work. hasName(x, "name") is not
sufficient for that: x might have that as a name, but x$name won't
work, e.g. in a named numeric vector. I don't think we have a simple
test corresponding to
!is.null(x$name) && hasName(x, "name")
Probably the best approach is to run tests with
options(warnPartialMatchDollar = TRUE), and just use the simple
!is.null(x$name).
Duncan Murdoch