 Code and Closure is organized into namespaces. Each namespace is known by a symbol name, and at any one time during evaluation, one namespace is the current namespace. Again, this current namespace is the one used by the evaluator when resolving symbols. When the closure runtime starts, the current namespace is a namespace called user, which conveniently contains everything from the standard library's closure.core namespace. So right at program start, a def form will modify the namespace called user, but we can also use the functions and macros of closure.core without having to fully qualify those symbols. The closure.core function inns as an in namespace changes the current namespace. Here, we quote the symbol foo to pass it to the inns function. If the namespace foo doesn't already exist, this call to inns will create it, and either way foo will henceforth be the current namespace. Be clear that this new namespace is completely blank and so does not contain the elements of closure.core like the user namespace does. We can get around this by fully qualifying our symbols with a namespace, but that's ugly and inconvenient. There's a better solution once we understand namespaces a little better. A namespace can actually have four different kinds of mappings. Symbols to vars interned, symbol to vars referred, symbols to classes, and symbols to namespaces. Interned mappings are the normal kind of mappings, the ones we create with the def special form. Here, for example, we assign foo to a var map to the symbol bar, and we use the def and macro to assign a function to a var map to the symbol zeros. Referred mappings, though, are created with the refer function. This function takes a symbol naming another namespace, and every interned mapping of that namespace is added as a referred mapping in the current namespace. Here, for each interned mapping in the namespace foo, this call to refer adds a referred mapping in the current namespace. Be clear, refer does not copy referred mappings of the other namespace, only its interned mappings. One way to think about this is that interned mappings are the true members of a namespace, whereas referred mappings are just borrowed from other namespaces for convenience. By using refer, we can conveniently use vars from other namespaces without having to fully qualify their names. Here, before referring the foo namespace, we have to qualify var of the foo namespace, but then afterwards we do not have to qualify var. It is common practice to refer closure.core into the current namespace so that we don't have to write closure.core every time we want to use one of its functions or macros. If a namespace we refer has a mapping of the same name as the current namespace, the refer function will throw an exception. We can get around this by resolving any conflicts in a map after the keyword rename. So this call refers the interned mappings of foo into the current namespace, but it creates a referred mapping called bob for foo slash alice and a referred mapping called david for foo slash carol. And this way we avoid a name collision if the current namespace already has things called alice and carol. Mappings to Java classes are created with the import macro. Here, this call to import maps the Java class java.util.date to a symbol of the same name in the current namespace. And understand that because import is a macro, the symbol argument gets passed un-evaluated so we don't quote it. Mappings to other namespaces are created with the alias function. When the evaluator resolves fully qualified symbols, it looks for the specified namespace in a global table of namespaces, but if not found there, it will also look for a namespace alias in the current namespace. So after we create this alias super, we can use it in place of the full name supercalifragilisticxpialidocious. When we start the closure runtime, we specify one source file to run. In our code, we can then load and run other source files with the load function of closure.core. The load function reads and evaluates the code in a file specified by a path relative to the Java class path. The file is expected to have the extension .clj, but that part is left implicit in the specified path. So this here loads the file bar slash baz.clj relative to the Java class path. By the way, from here on out, we'll always assume that closure.core is referred into the current namespace. A closure lib is a source file located at a path, relative to the Java class path, that corresponds to a symbolic name. For example, a source file stored at richard slash millhouse slash nixon.clj has the lib name richard dot millhouse dot nixon. By convention, a lib should create a namespace of the same name as a lib itself. A very large lib might create additional namespaces, but this is not a very common thing to do. If a lib source file becomes too large, you might wish to move some of its code into separate files. Common practice is to place these other files in the same directory, and then use the load function to run them from the main lib file. The require function loads a lib by its symbolic name. This loads the file closure slash java slash io.clj relative to the Java class path. When running a source file, the code in that file might change the current namespace, but unlike the load function, require ensures that the current namespace at the end of the call is set to the same namespace as at the start of the call. The require function takes several different options for convenience. We won't go into these options, but here's one example. This example requires the lib closure dot java dot io, but the imported namespace is known by the symbol bar, not closure dot java dot io. The use function is like require, but also refers the required lib's namespace into the current namespace. So this here loads closure dot java slash io.clj relative to the java class path, and then it refers the closure dot java dot io namespace. Rather than use nns, require, use, and import directly, it is most common to use the ns macro, which bundles this functionality together into one macro. A typical lib will start with a single use of ns. The macro has many options, which we won't go into, but here's a simple example. Here, the ns macro switches the current namespace to foo.bar, into which it requires closure dot contrib dot sequel, uses closure dot test, and imports java dot util dot date and java dot util dot timer. Note that because ns is a macro, we don't quote the symbols which specify the lib and class names. Now, let's take a look at the ns macro. The ns macro switches the current namespace to foo.bar, into which it requires closure dot contrib dot contrib dot. The ns macro switches the current namespace to foo.bar, into which it requires closure dot contrib dot.