clojure-emacs/sayid

Symbol's value as a variable is void: sayid-ring

Closed this issue · 6 comments

I have sayid installed both on the emacs and clojure side. Curerntly, sayid-version displays 0.0.17 both for clj and el. This is the content of my ~/.lein/profiles.clj:

{:user {:plugins [[cider/cider-nrepl "0.18.0"]
                  [com.billpiel/sayid "0.0.17"]]
        :dependencies [[org.clojure/tools.nrepl "0.2.12"]]}}

I tried setting up a very minimal example:

(ns sayid-test.core
  (:gen-class))

(defn foo [x]
  (max 1 2 3 (+ x (* x 3))))

After evaling this buffer with cider-eval-buffer, I run sayid-trace-ns-in-file and get the expected message:

Traced namespaces:
  1 / 1  sayid-test.core


Traced functions:

After this, I open a REPL and eval (foo 5), which should make sayid trace the run of the function. And then, when I run sayid-get-workspace, I find myself with an empty buffer, and the error message: Symbol's value as a variable is void: sayid-ring

Any idea what could be wrong?

bpiel commented

@setzer22 what version of emacs?

You could try opening sayid.el in a buffer and call eval-buffer on it and see if any error messages are generated.

https://github.com/clojure-emacs/sayid/blob/master/src/el/sayid.el

I'm using emacs 26.1, in Arch Linux.

I've tried opening sayid.el, and after calling eval-buffer on it I can see no errors. However, I explored a bit and found the definition of sayid-ring:

(defvar sayid-ring)

It seems changing it to (defvar sayid-ring '()) fixed my issue! Maybe the default behaviour of defvar changed recently?

bpiel commented

@setzer22 Yes, I was guessing something like that. Thanks for looking into it.

Thanks for this awesome tool! I'm glad I can start using it 😄

Btw, in Emacs Lisp nil an () are the same thing. Kind of weird, but it's true. :-)

Just ran into this problem, too, pushed a fix in #44.