Working with namespaces, modules, and packages

The Julia ecosystem lives on a namespace; in fact, this is the only way we can keep things in order. Why do I say that? The reason is that namespaces are used to logically separate fragments of source code so that they can be developed independently without affecting each other. If I define a function in one namespace, I will still be able to define another function in a different namespace even though both functions have the same name. 

In Julia, namespaces are created using modules and submodules. In order to manage distribution and dependencies, modules are generally organized as packages. There is a standard directory structure for Julia packages. Although the top level directory structure is well defined, the programmer still has a lot of freedom in organizing source files.

In this section, we will explore the following topics:

  • Understanding and using namespaces 
  • How to create modules and packages
  • How to create submodules
  • How to organize files in a module

Let's learn about each in detail in the following sections.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset