Lets say I have a namespace declaration like this:
(ns my.core
(:require [other.stuff :as stuff]))
(defn a [] (stuff/x))
I’ve figured that it could be neat to create a “duplicate” namespace when debugging, and the most basic way would be to do something like this:
(ns my.debugging)
(use 'my.core)
(a)
So far so good. But I’d also like to duplicate the require-statement of my.core, since this won’t work (in my.debugging):
(stuff/x)
Is there a way to get all the dependencies of a namespace (programatically) copied into the current namespace, in such a way that I can use the same aliases e.t.c.?
Cool, almost there. What’s missing now is when a ns is declared like so:
(ns my.core
(:require [other.stuff :refer :all]))
Is there a way to import those too?
With regards to “why?”, the reason is that through https://github.com/Saikyun/miracle.save I currently def in the current namespace. If it was easy to “clone” it, I wouldn’t pollute the current namespace.