<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent activity in tools.namespace</title>
<link>https://ask.clojure.org/index.php/activity/contrib-libs/tools-namespace</link>
<description></description>
<item>
<title>Commented: tools.namespace remove-node does not remove outgoing dependencies from :dependents</title>
<link>https://ask.clojure.org/index.php/14345/namespace-remove-remove-outgoing-dependencies-dependents?show=14378#c14378</link>
<description>Sorry for the late reply here, things got busy the past couple weeks.&lt;br /&gt;
&lt;br /&gt;
These are great ideas – I hadn't considered using grep on the git history.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Looks like there are only two usages of remove-node in tools.namespace (I still need to check on other clojure projects):&lt;br /&gt;
1. dependency/topo-sort&lt;br /&gt;
&amp;nbsp;&amp;nbsp;- The change I made doesn't have any effect here, since the function already calls remove-edge elsewhere with each node and its own dependencies.&lt;br /&gt;
2. track/remove-deps &amp;gt; track/add&lt;br /&gt;
&amp;nbsp;&amp;nbsp;- There are other functions much higher up the chain (dir/scan-files, dir/scan-dirs, repl/scan) where I noticed something off with the behavior. These are what I created the &amp;quot;proposed fix&amp;quot; tests against.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A search on &amp;quot;remove-node&amp;quot; in git history brought back a commit from 2021. Looks more related to some upstream functionality than to remove-node itself, but the author did provide a good bit of context:&lt;br /&gt;
&lt;br /&gt;
commit 5aaa6a328c8aaf0ae8ea7e5c48736eb2f1825392&lt;br /&gt;
Author: zalky &amp;lt;zalan.k@gmail.com&amp;gt;&lt;br /&gt;
Date: &amp;nbsp;&amp;nbsp;Mon May 24 13:08:30 2021 -0400&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Fix TNS-6: fully remove ns from deps graph&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;The clojure.tools.namespace.dependency/remove-node fn removes a&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;namespace's :dependencies set from the graph (outgoing edges), but&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;does not remove that namespace from the :dependents set of other&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;namespaces (ingoing edges). If a namespace is removed and one of its&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dependencies is changed at the same time, as commonly occurs when&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;switching branches, then the removed namespace is still in the&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;:dependents of the changed namespace when it is reloaded. As all the&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;of the dependents of a changed namespace are also reloaded, this&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throws a missing namespace error.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;The resolution is to use clojure.tools.namespace.depedency/remove-all&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;to remove both outgoing (:dependencies) and ingoing (:dependents)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;edges in the dependency graph.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;However, care must be taken when choosing the point of change, because&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;clojure.tools.namespace.track/add relies on the partial removal&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;behaviour of clojure.tools.namespace.track/remove-deps. It uses&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;remove-deps to wipe the dependencies of a node, and cannot know how to&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;re-insert dependents if lost. Therefore the point of change should be&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;in clojure.tools.namespace.track/remove.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am now leaning toward your suggestion of a new operation since there is this precedence of not changing the remove-node function.&lt;br /&gt;
&lt;br /&gt;
Another possible solution that would solve the heart of the problem (repl/scan) would be to update the remove-deps function in clojure.tools.namespace.track with something like this:&lt;br /&gt;
&lt;br /&gt;
(defn- remove-edges [deps node]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;(-&amp;gt;&amp;gt; (dep/immediate-dependencies deps node)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(reduce #(dep/remove-edge %1 node %2) deps)))&lt;br /&gt;
&lt;br /&gt;
(defn- remove-deps [deps names]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;(reduce remove-edges deps names))</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14345/namespace-remove-remove-outgoing-dependencies-dependents?show=14378#c14378</guid>
<pubDate>Sat, 08 Feb 2025 19:42:53 +0000</pubDate>
</item>
<item>
<title>Retagged: tools.namespace no longer returns declared metadata on namespace</title>
<link>https://ask.clojure.org/index.php/12965/tools-namespace-longer-returns-declared-metadata-namespace?show=12965#q12965</link>
<description>&lt;h3&gt;Problem&lt;/h3&gt;
&lt;p&gt;v1.4.0 of &lt;code&gt;tools.namespace&lt;/code&gt; returns metadata from namespace declarations. Newer versions do not.&lt;/p&gt;
&lt;h3&gt;Reproduction&lt;/h3&gt;
&lt;p&gt;Given &lt;code&gt;./src/foo.clj&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ns ^{:doc &quot;foo&quot; :no-doc true} foo)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And &lt;code&gt;./test.clj&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(require '[clojure.tools.namespace.find :as f]
         '[clojure.java.io :as io])

(binding [*print-meta* true]
  (pr (f/find-ns-decls-in-dir (io/file &quot;src&quot;))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If I use v1.4.0, I get the &lt;code&gt;foo&lt;/code&gt; ns &lt;code&gt;:doc&lt;/code&gt; and &lt;code&gt;:no-doc&lt;/code&gt; metadata:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;❯ clj -Sdeps '{:deps {org.clojure/tools.namespace {:mvn/version &quot;1.4.0&quot;}}}' -M test.clj
((ns ^{:doc &quot;foo&quot;, :no-doc true} foo))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But if I use v1.4.4, the ns metadata includes the new generated &lt;code&gt;:dir&lt;/code&gt; and &lt;code&gt;:file&lt;/code&gt; metadata from tools.namespace, but not the &lt;code&gt;:doc&lt;/code&gt; and &lt;code&gt;:no-doc&lt;/code&gt; metadata:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;❯ clj -Sdeps '{:deps {org.clojure/tools.namespace {:mvn/version &quot;1.4.4&quot;}}}' -M test.clj
((ns ^{:dir &quot;src&quot;, :file &quot;foo.clj&quot;} foo))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This has been true since v1.4.1 when the jar/dir and file metadata feature was introduced:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;❯ clj -Sdeps '{:deps {org.clojure/tools.namespace {:mvn/version &quot;1.4.1&quot;}}}' -M test.clj
((ns ^{:dir &quot;src&quot;, :file &quot;foo.clj&quot;} foo))
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Additional Info&lt;/h3&gt;
&lt;p&gt;The same issue should exhibit for &lt;code&gt;find-ns-decls-in-jarfile&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Usage Scenario&lt;/h3&gt;
&lt;p&gt;Cljdoc uses tools.namespace to learn about namespaces before attempting to load them. It skips namespaces that have &lt;code&gt;:no-doc&lt;/code&gt; and/or &lt;code&gt;:skip-wiki&lt;/code&gt; metadata.&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12965/tools-namespace-longer-returns-declared-metadata-namespace?show=12965#q12965</guid>
<pubDate>Tue, 30 May 2023 04:56:06 +0000</pubDate>
</item>
<item>
<title>Commented: clojure.tools.namespace throws casting error when calling find-ns-decls-in-jarfile</title>
<link>https://ask.clojure.org/index.php/12732/clojure-tools-namespace-throws-casting-error-calling-jarfile?show=12763#c12763</link>
<description>Great, thanks!</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12732/clojure-tools-namespace-throws-casting-error-calling-jarfile?show=12763#c12763</guid>
<pubDate>Mon, 13 Mar 2023 23:00:11 +0000</pubDate>
</item>
<item>
<title>Answered: How to restrict namespaces reloaded by tools.namespace to only dependencies of a root ns?</title>
<link>https://ask.clojure.org/index.php/12724/restrict-namespaces-reloaded-tools-namespace-dependencies?show=12727#a12727</link>
<description>&lt;p&gt;Another related one is &lt;a rel=&quot;nofollow&quot; href=&quot;https://ask.clojure.org/index.php/11434/could-namespace-refresh-sophisticated-directory-filtering&quot;&gt;https://ask.clojure.org/index.php/11434/could-namespace-refresh-sophisticated-directory-filtering&lt;/a&gt;&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12724/restrict-namespaces-reloaded-tools-namespace-dependencies?show=12727#a12727</guid>
<pubDate>Sat, 04 Mar 2023 22:36:00 +0000</pubDate>
</item>
<item>
<title>Retagged: Should tools.namespace find still cope with namespace-less sources?</title>
<link>https://ask.clojure.org/index.php/12677/should-tools-namespace-find-still-cope-with-namespace-sources?show=12677#q12677</link>
<description>&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;&lt;br&gt;
Tools.namespace find 1.4.1 does not handle sources that don't include a &lt;code&gt;ns&lt;/code&gt; declaration.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reproduction&lt;/strong&gt;&lt;br&gt;
Given file &lt;code&gt;./src/foo.clj&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;;; no ns declaration here
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And test script &lt;code&gt;./test.clj&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(require '[clojure.tools.namespace.find :as f]
         '[clojure.java.io :as io])

(println &quot;found nses:&quot; (f/find-ns-decls-in-dir (io/file &quot;src&quot;)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can see that &lt;code&gt;tools.namespace 1.4.0&lt;/code&gt; returns an empty sequence for this scenario:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ clj -Sdeps '{:deps {org.clojure/tools.namespace {:mvn/version &quot;1.4.0&quot;}}}' -M --report stderr test.clj
found nses: ()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But version 1.4.1 throws an exception for this same test:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ clj -Sdeps '{:deps {org.clojure/tools.namespace {:mvn/version &quot;1.4.1&quot;}}}' -M --report stderr test.clj
{:clojure.main/message
 &quot;Execution error (NullPointerException) at clojure.tools.namespace.find/find-ns-decls-in-dir$fn (find.clj:93).\nCannot invoke \&quot;clojure.lang.IObj.withMeta(clojure.lang.IPersistentMap)\&quot; because \&quot;x\&quot; is null\n&quot;,
 :clojure.main/triage
 {:clojure.error/class java.lang.NullPointerException,
  :clojure.error/line 93,
  :clojure.error/cause
  &quot;Cannot invoke \&quot;clojure.lang.IObj.withMeta(clojure.lang.IPersistentMap)\&quot; because \&quot;x\&quot; is null&quot;,
  :clojure.error/symbol
  clojure.tools.namespace.find/find-ns-decls-in-dir$fn,
  :clojure.error/source &quot;find.clj&quot;,
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type clojure.lang.Compiler$CompilerException,
    :message
    &quot;Syntax error macroexpanding at (/home/lee/proj/oss/-verify/tns-test/test.clj:4:1).&quot;,
    :data
    {:clojure.error/phase :execution,
     :clojure.error/line 4,
     :clojure.error/column 1,
     :clojure.error/source
     &quot;/home/lee/proj/oss/-verify/tns-test/test.clj&quot;},
    :at [clojure.lang.Compiler load &quot;Compiler.java&quot; 7665]}
   {:type java.lang.NullPointerException,
    :message
    &quot;Cannot invoke \&quot;clojure.lang.IObj.withMeta(clojure.lang.IPersistentMap)\&quot; because \&quot;x\&quot; is null&quot;,
    :at [clojure.core$with_meta__5485 invokeStatic &quot;core.clj&quot; 220]}],
  :trace
  [[clojure.core$with_meta__5485 invokeStatic &quot;core.clj&quot; 220]
   [clojure.core$with_meta__5485 invoke &quot;core.clj&quot; 219]
   [clojure.tools.namespace.find$find_ns_decls_in_dir$fn__1437
    invoke
    &quot;find.clj&quot;
    93]
   [clojure.core$keep$fn__8649 invoke &quot;core.clj&quot; 7409]
   [clojure.lang.LazySeq sval &quot;LazySeq.java&quot; 42]
   [clojure.lang.LazySeq seq &quot;LazySeq.java&quot; 51]
   [clojure.lang.RT seq &quot;RT.java&quot; 535]
   [clojure.core$seq__5467 invokeStatic &quot;core.clj&quot; 139]
   [clojure.core$print_sequential invokeStatic &quot;core_print.clj&quot; 53]
   [clojure.core$fn__7391 invokeStatic &quot;core_print.clj&quot; 174]
   [clojure.core$fn__7391 invoke &quot;core_print.clj&quot; 174]
   [clojure.lang.MultiFn invoke &quot;MultiFn.java&quot; 234]
   [clojure.core$pr_on invokeStatic &quot;core.clj&quot; 3675]
   [clojure.core$pr invokeStatic &quot;core.clj&quot; 3678]
   [clojure.core$pr invoke &quot;core.clj&quot; 3678]
   [clojure.lang.AFn applyToHelper &quot;AFn.java&quot; 154]
   [clojure.lang.RestFn applyTo &quot;RestFn.java&quot; 132]
   [clojure.core$apply invokeStatic &quot;core.clj&quot; 667]
   [clojure.core$pr invokeStatic &quot;core.clj&quot; 3691]
   [clojure.core$pr doInvoke &quot;core.clj&quot; 3678]
   [clojure.lang.RestFn applyTo &quot;RestFn.java&quot; 139]
   [clojure.core$apply invokeStatic &quot;core.clj&quot; 667]
   [clojure.core$prn invokeStatic &quot;core.clj&quot; 3715]
   [clojure.core$prn doInvoke &quot;core.clj&quot; 3715]
   [clojure.lang.RestFn applyTo &quot;RestFn.java&quot; 137]
   [clojure.core$apply invokeStatic &quot;core.clj&quot; 667]
   [clojure.core$println invokeStatic &quot;core.clj&quot; 3734]
   [clojure.core$println doInvoke &quot;core.clj&quot; 3734]
   [clojure.lang.RestFn invoke &quot;RestFn.java&quot; 421]
   [user$eval1480 invokeStatic &quot;test.clj&quot; 4]
   [user$eval1480 invoke &quot;test.clj&quot; 4]
   [clojure.lang.Compiler eval &quot;Compiler.java&quot; 7194]
   [clojure.lang.Compiler load &quot;Compiler.java&quot; 7653]
   [clojure.lang.Compiler loadFile &quot;Compiler.java&quot; 7591]
   [clojure.main$load_script invokeStatic &quot;main.clj&quot; 475]
   [clojure.main$script_opt invokeStatic &quot;main.clj&quot; 535]
   [clojure.main$script_opt invoke &quot;main.clj&quot; 530]
   [clojure.main$main invokeStatic &quot;main.clj&quot; 664]
   [clojure.main$main doInvoke &quot;main.clj&quot; 616]
   [clojure.lang.RestFn applyTo &quot;RestFn.java&quot; 137]
   [clojure.lang.Var applyTo &quot;Var.java&quot; 705]
   [clojure.main main &quot;main.java&quot; 40]],
  :cause
  &quot;Cannot invoke \&quot;clojure.lang.IObj.withMeta(clojure.lang.IPersistentMap)\&quot; because \&quot;x\&quot; is null&quot;,
  :phase :execution}}

Execution error (NullPointerException) at clojure.tools.namespace.find/find-ns-decls-in-dir$fn (find.clj:93).
Cannot invoke &quot;clojure.lang.IObj.withMeta(clojure.lang.IPersistentMap)&quot; because &quot;x&quot; is null
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Usage Scenario&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Cljdoc uses tools.namespace to find namespaces during API analysis.&lt;/p&gt;
&lt;p&gt;Various libs include all sorts of weirdnesses including namespace-less sources.&lt;/p&gt;
&lt;p&gt;Previous versions of tools.namespace handled this weirdness for us.&lt;/p&gt;
&lt;p&gt;We can certainly work around this if it is decided that tools.namespace should not handle namespace-less sources.&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12677/should-tools-namespace-find-still-cope-with-namespace-sources?show=12677#q12677</guid>
<pubDate>Wed, 01 Mar 2023 16:37:51 +0000</pubDate>
</item>
<item>
<title>Answered: Exposing namespaces that will be reloaded from c.t.n.repl</title>
<link>https://ask.clojure.org/index.php/12231/exposing-namespaces-that-will-be-reloaded-from-c-t-n-repl?show=12264#a12264</link>
<description>&lt;p&gt;Created jira at &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/TNS-58&quot;&gt;https://clojure.atlassian.net/browse/TNS-58&lt;/a&gt;&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12231/exposing-namespaces-that-will-be-reloaded-from-c-t-n-repl?show=12264#a12264</guid>
<pubDate>Thu, 29 Sep 2022 20:21:35 +0000</pubDate>
</item>
<item>
<title>Answered: Could tools.namespace refresh get more sophisticated directory/file filtering?</title>
<link>https://ask.clojure.org/index.php/11434/could-namespace-refresh-sophisticated-directory-filtering?show=11885#a11885</link>
<description>&lt;p&gt;There is now a &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clj-kondo/clj-kondo/issues/1685&quot;&gt;clj-kondo issue&lt;/a&gt; to try and solve this from that side.&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11434/could-namespace-refresh-sophisticated-directory-filtering?show=11885#a11885</guid>
<pubDate>Mon, 09 May 2022 15:24:00 +0000</pubDate>
</item>
<item>
<title>Commented: tools.namespace does not recognise ns deps implied by data_readers.cljc</title>
<link>https://ask.clojure.org/index.php/11845/tools-namespace-does-recognise-deps-implied-datareaders?show=11884#c11884</link>
<description>hmm - that's a killer point @alexmiller - which means that my understanding of why things are failing after `c.t.n.r/refresh` (but never in prod) is flawed &lt;br /&gt;
&lt;br /&gt;
back to the drawing board</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11845/tools-namespace-does-recognise-deps-implied-datareaders?show=11884#c11884</guid>
<pubDate>Mon, 09 May 2022 12:00:22 +0000</pubDate>
</item>
<item>
<title>Answer selected: Resolution for bug TNS-6 in clojure.tools.namespace</title>
<link>https://ask.clojure.org/index.php/10655/resolution-for-bug-tns-6-in-clojure-tools-namespace?show=10656#a10656</link>
<description>&lt;p&gt;Are you interested in becoming a contributor and submitting the patch? If so, please sign the Contributor Agreement and file a support request to get a jira account per &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/dev/dev#_becoming_a_contributor&quot;&gt;https://clojure.org/dev/dev#_becoming_a_contributor&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If not, then I can't actually look at your patch, but perhaps you could describe the problem and solution and a contributor can write a clean patch.&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10655/resolution-for-bug-tns-6-in-clojure-tools-namespace?show=10656#a10656</guid>
<pubDate>Thu, 27 May 2021 03:17:11 +0000</pubDate>
</item>
<item>
<title>Commented: Preventing `clojure.tools.namespace.repl/refresh` from loading namespaces that haven't been loaded before</title>
<link>https://ask.clojure.org/index.php/10277/preventing-clojure-namespace-refresh-loading-namespaces?show=10397#c10397</link>
<description>&amp;gt; It's not gone at all if the two files are in the same dir.&lt;br /&gt;
&lt;br /&gt;
It is poor practice to place non-loadable namespace under `src/` or `test/`. It directly affects other users and tools.&lt;br /&gt;
&lt;br /&gt;
If you have non-loadable namespaces, it's better to place them under `examples/`, `drafts/` &amp;nbsp;or such.</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10277/preventing-clojure-namespace-refresh-loading-namespaces?show=10397#c10397</guid>
<pubDate>Fri, 02 Apr 2021 17:07:59 +0000</pubDate>
</item>
<item>
<title>Answered: Should tools.namespace.repl/refresh exclude code found in ~/.gitlibs?</title>
<link>https://ask.clojure.org/index.php/10381/should-tools-namespace-repl-refresh-exclude-found-gitlibs?show=10394#a10394</link>
<description>&lt;p&gt;It is a really good idea to &lt;code&gt;set-refresh-dirs&lt;/code&gt; in advance. Examples, production-oriented scripts, drafted code, etc - none of those tend to be safe to &lt;code&gt;require&lt;/code&gt; blindly (which is what &lt;code&gt;(refresh)&lt;/code&gt; does when unconfigured).&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10381/should-tools-namespace-repl-refresh-exclude-found-gitlibs?show=10394#a10394</guid>
<pubDate>Fri, 02 Apr 2021 02:12:45 +0000</pubDate>
</item>
<item>
<title>Edited: Would be nice if tools.namespace.find functions return file info in ns-decl meta</title>
<link>https://ask.clojure.org/index.php/8826/would-nice-tools-namespace-find-functions-return-file-info?show=8826#q8826</link>
<description>&lt;p&gt;Currently calling &lt;code&gt;tools.namespace.find/find-ns-decls&lt;/code&gt; returns a seq of ns-decl for a given dir or collection of paths but there is no way to know where did they came from (can also be coming from paths inside jar files).&lt;/p&gt;
&lt;p&gt;Looks pretty straight forward to add file info as meta of the ns-decl form. Something like &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/jpmonettas/tools.namespace/commit/1431215324ba7f76f78342742ce3716ec8c5abb8&quot;&gt;https://github.com/jpmonettas/tools.namespace/commit/1431215324ba7f76f78342742ce3716ec8c5abb8&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;What do you guys think?&lt;/p&gt;
&lt;p&gt;(Filed jira at &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/TNS-55&quot;&gt;https://clojure.atlassian.net/browse/TNS-55&lt;/a&gt;)&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8826/would-nice-tools-namespace-find-functions-return-file-info?show=8826#q8826</guid>
<pubDate>Thu, 14 Nov 2019 15:01:40 +0000</pubDate>
</item>
<item>
<title>Commented: How does tools.namespace.track/add is supposed to work?</title>
<link>https://ask.clojure.org/index.php/8737/how-does-tools-namespace-track-add-is-supposed-to-work?show=8783#c8783</link>
<description>Already figured out that you need to dissoc unload and loads when processing them, I was confused because I was expecting a tracker api for this. Thanks!</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8737/how-does-tools-namespace-track-add-is-supposed-to-work?show=8783#c8783</guid>
<pubDate>Sun, 27 Oct 2019 14:42:55 +0000</pubDate>
</item>
<item>
<title>Commented: Java 11 and Tools Namespace</title>
<link>https://ask.clojure.org/index.php/8288/java-11-and-tools-namespace?show=8597#c8597</link>
<description>The problem, as Juraj Martinka has identified, is with `(clojure.java.classpath/classpath)` in certain contexts. I have added my own comments at &lt;a href=&quot;https://github.com/clojure-emacs/cider/issues/2686#issuecomment-531366583&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://github.com/clojure-emacs/cider/issues/2686#issuecomment-531366583&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
There have been multiple workarounds in java.classpath for different environments. The current behavior was added in &lt;a href=&quot;https://clojure.atlassian.net/browse/CLASSPATH-8&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/CLASSPATH-8&lt;/a&gt; to work around changes to the classloader hierarchy in Java 9. The relevant lines are &amp;nbsp;&lt;a href=&quot;https://github.com/clojure/java.classpath/blob/68f972cd47adcc248d205265ae352ca4caaa117a/src/main/clojure/clojure/java/classpath.clj#L86-L87&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://github.com/clojure/java.classpath/blob/68f972cd47adcc248d205265ae352ca4caaa117a/src/main/clojure/clojure/java/classpath.clj#L86-L87&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
At first glance, Juraj Martinka's suggestion — to combine the two classpath sources — looks like a viable solution, although I do have questions about possible duplication of paths. I would also like to understand why the CIDER jack-in process produces this result before making changes. I will wait to see if someone on the CIDER issue thread can help with an explanation.</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8288/java-11-and-tools-namespace?show=8597#c8597</guid>
<pubDate>Fri, 13 Sep 2019 21:11:14 +0000</pubDate>
</item>
<item>
<title>Answer selected: Is it usual to require all application namespaces via tools.namespace?</title>
<link>https://ask.clojure.org/index.php/8325/usual-require-all-application-namespaces-tools-namespace?show=8408#a8408</link>
<description>&lt;p&gt;As asked: &quot;Is it usual to require all application namespaces via tools.namespace?&quot;&lt;/p&gt;
&lt;p&gt;No, definitely not &quot;usual&quot;.&lt;/p&gt;
&lt;p&gt;It's not particularly usual to have multimethod/protocol implementations spread across so many namespaces -- that are otherwise not required by code that uses those multimethods/protocols -- that a list of requires of them is particularly &quot;noisy&quot;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;tools.deps&lt;/code&gt; has a number of provider implementations spread across namespaces but it requires all the built-in ones in the &quot;entry point&quot; namespace for other code that uses the library. See &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/tools.deps.alpha/blob/860bc7e3e310380b3baf9b43b05d343f3ae812f6/src/main/clojure/clojure/tools/deps/alpha.clj#L17-L22&quot;&gt;https://github.com/clojure/tools.deps.alpha/blob/860bc7e3e310380b3baf9b43b05d343f3ae812f6/src/main/clojure/clojure/tools/deps/alpha.clj#L17-L22&lt;/a&gt; -- I don't know whether you'd consider that &quot;noisy&quot;?&lt;/p&gt;
&lt;p&gt;If you really do have a &quot;lot&quot; of implementation namespaces that are not likely to be required by any other code, and therefore need loading somewhere near startup, then I would first consider creating an interim namespace that does the requiring and then just require that in your initial namespace.&lt;/p&gt;
&lt;p&gt;If that still seems too noisy, I might consider using &lt;code&gt;tools.namespace&lt;/code&gt; to automatically find and load just the implementation namespaces, assuming they follow an appropriate pattern. But I've never run across that need in eight years of production Clojure so far.&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8325/usual-require-all-application-namespaces-tools-namespace?show=8408#a8408</guid>
<pubDate>Tue, 13 Aug 2019 05:30:27 +0000</pubDate>
</item>
<item>
<title>Answered: scan-dirs / scan-all can return incorrect dependencies when both clj and cljc files define same namespace</title>
<link>https://ask.clojure.org/index.php/8047/return-incorrect-dependencies-cljc-files-define-namespace?show=8070#a8070</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/TNS-42&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/TNS-42&lt;/a&gt; (reported by jafingerhut)</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8047/return-incorrect-dependencies-cljc-files-define-namespace?show=8070#a8070</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: File in invalid path will mark namespace for reload</title>
<link>https://ask.clojure.org/index.php/8052/file-in-invalid-path-will-mark-namespace-for-reload?show=8085#a8085</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/TNS-45&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/TNS-45&lt;/a&gt; (reported by deraen)</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8052/file-in-invalid-path-will-mark-namespace-for-reload?show=8085#a8085</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: ns-decl? treats (ns) as valid</title>
<link>https://ask.clojure.org/index.php/8050/ns-decl-treats-ns-as-valid?show=8077#a8077</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/TNS-43&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/TNS-43&lt;/a&gt; (reported by techpractical)</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8050/ns-decl-treats-ns-as-valid?show=8077#a8077</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: `require :reload` fails where `load-file` succeeds</title>
<link>https://ask.clojure.org/index.php/8049/require-reload-fails-where-load-file-succeeds?show=8076#a8076</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/TNS-50&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/TNS-50&lt;/a&gt; (reported by alex+import)</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8049/require-reload-fails-where-load-file-succeeds?show=8076#a8076</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Broken tracker after mis-named namespace</title>
<link>https://ask.clojure.org/index.php/8048/broken-tracker-after-mis-named-namespace?show=8074#a8074</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/TNS-24&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/TNS-24&lt;/a&gt; (reported by stuart.sierra)</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8048/broken-tracker-after-mis-named-namespace?show=8074#a8074</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: c.t.n.move: does not support to move .cljc files</title>
<link>https://ask.clojure.org/index.php/8051/c-t-n-move-does-not-support-to-move-cljc-files?show=8080#a8080</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/TNS-37&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/TNS-37&lt;/a&gt; (reported by benedek.fazekas)</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8051/c-t-n-move-does-not-support-to-move-cljc-files?show=8080#a8080</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Show full path for circular dependency exceptions</title>
<link>https://ask.clojure.org/index.php/8046/show-full-path-for-circular-dependency-exceptions?show=8069#a8069</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/TNS-49&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/TNS-49&lt;/a&gt; (reported by alex+import)</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8046/show-full-path-for-circular-dependency-exceptions?show=8069#a8069</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Breakage with tools.reader 1.3.0</title>
<link>https://ask.clojure.org/index.php/8045/breakage-with-tools-reader-1-3-0?show=8068#a8068</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/TNS-53&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/TNS-53&lt;/a&gt; (reported by bozhidar)</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8045/breakage-with-tools-reader-1-3-0?show=8068#a8068</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Support namespaces as strings in require statements</title>
<link>https://ask.clojure.org/index.php/8044/support-namespaces-as-strings-in-require-statements?show=8067#a8067</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/TNS-51&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/TNS-51&lt;/a&gt; (reported by viebel)</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8044/support-namespaces-as-strings-in-require-statements?show=8067#a8067</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Ability to track files that are not namespaces</title>
<link>https://ask.clojure.org/index.php/8043/ability-to-track-files-that-are-not-namespaces?show=8061#a8061</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/TNS-48&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/TNS-48&lt;/a&gt; (reported by rymndhng)</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8043/ability-to-track-files-that-are-not-namespaces?show=8061#a8061</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Generating namespace forms</title>
<link>https://ask.clojure.org/index.php/8042/generating-namespace-forms?show=8060#a8060</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/TNS-52&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/TNS-52&lt;/a&gt; (reported by lynaghk)</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8042/generating-namespace-forms?show=8060#a8060</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Attempt to reload deleted file</title>
<link>https://ask.clojure.org/index.php/8041/attempt-to-reload-deleted-file?show=8056#a8056</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/TNS-6&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/TNS-6&lt;/a&gt; (reported by stuart.sierra)</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8041/attempt-to-reload-deleted-file?show=8056#a8056</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Add project.clj for easier development</title>
<link>https://ask.clojure.org/index.php/8040/add-project-clj-for-easier-development?show=8055#a8055</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/TNS-46&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/TNS-46&lt;/a&gt; (reported by deraen)</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8040/add-project-clj-for-easier-development?show=8055#a8055</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Stack overflow on refresh after circular dependency detected</title>
<link>https://ask.clojure.org/index.php/8039/stack-overflow-refresh-after-circular-dependency-detected?show=8054#a8054</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/TNS-7&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/TNS-7&lt;/a&gt; (reported by stuart.sierra)</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8039/stack-overflow-refresh-after-circular-dependency-detected?show=8054#a8054</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Single classpath argument for c.t.n.move</title>
<link>https://ask.clojure.org/index.php/8038/single-classpath-argument-for-c-t-n-move?show=8053#a8053</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/TNS-39&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/TNS-39&lt;/a&gt; (reported by stuart.sierra)</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8038/single-classpath-argument-for-c-t-n-move?show=8053#a8053</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
</channel>
</rss>