Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong type argument #22

Closed
DonyorM opened this issue Mar 8, 2017 · 8 comments
Closed

Wrong type argument #22

DonyorM opened this issue Mar 8, 2017 · 8 comments

Comments

@DonyorM
Copy link

DonyorM commented Mar 8, 2017

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
Copy link
Collaborator

bpiel commented Mar 8, 2017

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
Copy link
Collaborator

bpiel commented Mar 8, 2017

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.

@DonyorM
Copy link
Author

DonyorM commented Mar 8, 2017

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
Copy link
Collaborator

bpiel commented Mar 8, 2017

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.

@DonyorM
Copy link
Author

DonyorM commented Mar 8, 2017

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!

@DonyorM DonyorM closed this as completed Mar 8, 2017
@bpiel
Copy link
Collaborator

bpiel commented Mar 8, 2017

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

#11

@DonyorM
Copy link
Author

DonyorM commented Mar 8, 2017

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

@bpiel
Copy link
Collaborator

bpiel commented Mar 8, 2017

Added an issue for the bug I noted above
#23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants