If you are dealing with a lot of things that have a state that you want to clear in order to have a clean development environment, you might consider doing one of the following:
1.) Review your design and see how much of this state is really needed. In many situations, you can use stateful atoms, refs, or other stateless objects unnecessarily, and if you take a more functional approach, you wonβt have to clarify the development environment often.
Assuming legitimate reasons for using the state:
2.) You can destroy the namespace and all contents with the clojure remove-ns function: for example. for a namespace called user.fancy-namespace , you can clear NS by running (remove-ns 'user.fancy-namespace') and then just reevaluating the namespace. This works well for cleaning up one namespace, but if the state objects that need to be cleaned up are in different namespaces, tedious execution may be required for each namespace.
3.) The Stuart Sierra component library was designed to manage components that include state. It is very useful for managing database connections, memcache clients, etc., but for its full use you will need to re-archive your project.
source share