nrepl

https://github.com/nrepl/nrepl || https://nrepl.org
bozhidar 2019-11-01T06:14:46.007Z

@pez Orchard is a regular library. Hacking on it is pretty natural IMO. Just take a look at <http://orchard.cljs.info|orchard.cljs.info>.

pez 2019-11-01T08:28:50.010500Z

@bozhidar, I’ve gotten that far. 😄 I should have been clearer… What I’d like to setup is so that I can run my orchard.info.clj end-to-end, from the editor and explore what happens down there in info.clj. If that’s possible.

bozhidar 2019-11-01T09:41:17.012100Z

@pez I just develop it like any other library and test the changes in the REPL, while hacking on something. Alternatively you can rebuild cider-nrepl with the snapshot of orchard and test your changes end-to-end in this manner.

pez 2019-11-01T09:46:55.014700Z

Yeah, I’ll just have to figure out why my lein install of cider-nrepl isn’t used. I’m doing it the “just another library way” now. Added this test: https://github.com/PEZ/orchard/commit/754ae065cac18e97db80164a261e8e44f76792b9 If you have feedback to an orchard noob, please don’t hesitate. 😃

pez 2019-11-01T12:10:05.019Z

I have isolated the problem down to that meta/ns-meta relies on (ns-publics) to give it something to get a var out of, and then run (var-meta) on that to get the file path. So then if the namespace doesn’t have any publics we get get a nil file entry. A brute fix is this

(defn ns-meta
  [ns]
  (when ns
    (merge
     (meta ns)
     {:ns (ns-name ns)
      :name (ns-name ns)
      :file (or (-&gt; (ns-publics ns)
                    first
                    second
                    var-meta
                    :file)
                (-&gt;
                 (ns/canonical-source ns)
                 .getPath))
      :line 1})))
But it feels like there should be something more elegant/safe… What do you guys think?