5

Is it possible to have a function in R under multiple levels of namespaces?

For example, can these functions exist?

Mymath::Trig::cosine( )
A::B::C::D::foo( )
Imran Ali
  • 2,223
  • 2
  • 28
  • 41
Chris
  • 748
  • 2
  • 8
  • 23

1 Answers1

2

I don't think so, because the parser doesn't even handle this syntax: a::b::c gives

Error: unexpected '::' in "a::b::"

i.e., we don't even get as far as searching for a thing in a namespace. In contrast a::b gives

Error in loadNamespace(name) : there is no package called ‘a’

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453