Imports and Depends

限于喜欢 提交于 2019-12-02 22:39:32

Couple of points, and I will admit that I also find this confusing at times. But I revisited it recently, and here is my take:

  1. "Depends" is how we used to do things; it is closest to "just loading all three":when your third depends on the other two, all three will get loaded.

  2. With Namespaces, we can also import. That brings in just the stated symbols, which can be data or functions. I use this sometimes; it will not load the other package that you import from but just make the stated symbols available. As such, it is "lighter" than Depends.

  3. If you do Depends, there is no need for Imports.

  4. That is correct: If you use declarations in in NAMESPACE to import symbols from another packages, that other package needs to be listed in Imports: in the DESCRIPTION file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!