22 The toolbox

 

The last chapter of the book collects a variety of functions in the standard library dedicated to solve specific problems. Some of the functions or macros in this chapter have been used throughout the book and here we are going into greater details. Functions in this chapter are grouped by their originating namespace. Here’s an overview:

  • clojure.xml, as the name implies, contains functions to read or write XML.
  • clojure.inspector contains tools to visualize data structures.
  • clojure.repl contains functions dedicated to improve the REPL experience.
  • clojure.main is the entry point to bootstrap and execute Clojure applications. It also contains the actual REPL implementation and a set of functions to customize the REPL experience.
  • clojure.java.browse contains a single public function browse-url to open a native browser given a specific URL.
  • clojure.java.shell: the most important function in this namespace is sh, a function to "shell-out" commands to the native operative system.
  • clojure.core.server contains the implementation of a socket server, a service that offers Clojure evaluation (similarly to the REPL) to remote clients.
  • clojure.java.io contains Clojure wrappers to manage the Java IO (Input/Output) system including files, streams, the classpath and more.
  • clojure.test is the testing framework that ships with Clojure. clojure.test is configurable and extensible.
  • clojure.java.javadoc contains facilities to access Java documentation using the default system browser.

22.1 clojure.xml

22.2 clojure.inspector

22.3 clojure.repl

22.4 clojure.main

22.5 clojure.java.browse

22.6 clojure.java.shell

22.7 clojure.core.server

22.8 clojure.java.io

22.9 clojure.test