Open flying-sheep opened 8 years ago
Perhaps, just separate the X11 and non-X11 checking.
Yea, first all non-X11 in one go, then X11...
BTW: why don't we do the checks on startup instead of each time? the only problem I can think of is when user installs something during the session and things like check_capability('png')
can't be changed from within the session, as all these are compiled into R, aren't they?
We could do it on startup, but we'll have to use an environment I think. In .onLoad I think?
Simply assigning to a variable at top level happens at compile time, so the check would return whatever capabilities the building system had at build time.
i just checked the code of
capabilities()
, and what @randy3k did in #62 is probably not that fast after all. this is the code:so there are 1-2 internal calls:
.Internal(capabilities())
.Internal(capabilitiesX11())
(ifany(nas %in% c('X11', 'jpeg', 'png', 'tiff'))
)