clojure-emacs/sayid

Nothing appearing in Sayid Workspace

Closed this issue · 2 comments

So I have a function I'm trying to trace. I can add a trace (I have done this with sayid-trace-ns-in-file, sayid-trace-fn-enable, and sayid-inner-trace-fn) but when I run the buffer with cider-load-buffer nothing appears in the sayid workspace. Here is the namespace:

(ns four-clojure.scratch
  (:require [four-clojure.core :as c]))

(def trans-test #{[8 4] [9 3] [4 2] [27 9]})

(defn transitive [s]
  (let [val-map (apply hash-map (flatten (vec s)))
        find-relations (fn find-relations [key]
                         (let [result (get val-map key)]
                           (if result
                             (lazy-seq (cons result (find-relations result))))))]
    (reduce (fn [coll item]
              (map (fn [x]
                     [item x]) (find-relations item)))
            #{} (keys val-map))))

(transitive trans-test)

I get a result in the minibuffer, so I know the code runs. The traces all appear in the trace buffer. No errors occur as far as I can see.

I have this setup in spacemacs, so that could be part of the issue. But before I dive into the mess, I'd like to make sure it really is just my setup.

bpiel commented

When you eval the whole buffer, you're resetting the function vars, which blows away the traces.

Right, I'll fix that.