clojure-emacs/sayid

Wrong type argument

DonyorM opened this issue · 8 comments

Currently try to work with sayid (still in spacemacs), but whenever I try to initiate a trace, I'm getting this error: sayid-write-resp-val-to-buf: Wrong type argument: listp, 19

Debugger entered--Lisp error: (wrong-type-argument listp 19)
  sayid-put-text-props(((0 19 (("start" 0) ("start-col" 0))) (19 39 (("start" 19) ("start-col" 0)))) #<buffer *sayid-traced*>)
  sayid-write-resp-val-to-buf(("Traced namespaces:\n\n\nTraced functions:\n" ((0 19 (("start" 0) ("start-col" 0))) (19 39 (("start" 19) ("start-col" 0))))) #<buffer *sayid-traced*>)
  sayid-setup-buf(("Traced namespaces:\n\n\nTraced functions:\n" ((0 19 (("start" 0) ("start-col" 0))) (19 39 (("start" 19) ("start-col" 0))))) t nil)
  sayid-req-insert-content(("op" "sayid-show-traced" "ns" nil))
  sayid-show-traced()
  sayid-remove-trace-fn()
  call-interactively(sayid-remove-trace-fn nil nil)
  command-execute(sayid-remove-trace-fn

In this case I was trying to remove a trace from this function:

(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))))

I get similar errors when enabling a trace or creating an inner trace. Creating an inner trace does cause the trace to appear on the sayid-traced buffer. Just enabling a trace does not making it appear in the traced buffer. In either case, the results do not appear in the sayid workspace when I run the method.

bpiel commented

Is this something that worked before and doesn't now?

Are you using the latest version (0.0.14) of sayid in clojure and emacs? The emacs package is now (as of yesterday) on MELPA.

If you have the right versions, running sayid-version in elisp should give you this:
clj=0.0.14 el=0.0.14

Let me know whether that's it.

bpiel commented

Hmmm.... tracing individual functions (C-c s t e or sayid-trace-fn-enable) isn't working for me, although I don't get an error. I always trace by ns, so I must've broken this and not caught it.

Your error may be unrelated though.

Ok I'll trace by ns. I am using the melpa version I believe. I got this: clj= el=0.0.14 when I ran sayid-version. Which is a bit weird, do I have clojure not set up right in my setup?

bpiel commented

ok, yeah you're using v0.0.11 or earlier of the sayid clj lib, which is not going to work with v0.0.14 of the emacs client (which you are using). You need to bump up to sayid v0.0.14 wherever you include it -- profiles.clj or project.clj I'd expect.

I see. A little deja-vu since last time I made this kind of error. A better error message for a mismatched version would be great. Thanks for helping me with this!

bpiel commented

Ha, true. I actually did add the other message you requested, but didn't get to comment/closing the ticket yet.

#11

I might have looked at the previous error to get a hint at the issue :)

bpiel commented

Added an issue for the bug I noted above
#23