This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-12-22
Channels
- # adventofcode (37)
- # beginners (74)
- # boot (2)
- # boot-dev (31)
- # cider (88)
- # clara (109)
- # cljs-dev (63)
- # clojure (96)
- # clojure-argentina (1)
- # clojure-czech (1)
- # clojure-dusseldorf (2)
- # clojure-france (2)
- # clojure-germany (3)
- # clojure-greece (2)
- # clojure-italy (5)
- # clojure-norway (1)
- # clojure-spain (1)
- # clojure-spec (25)
- # clojure-uk (46)
- # clojurescript (26)
- # cursive (19)
- # data-science (5)
- # docs (2)
- # duct (18)
- # editors (2)
- # emacs (3)
- # figwheel (2)
- # fulcro (29)
- # graphql (3)
- # hoplon (143)
- # juxt (7)
- # klipse (1)
- # leiningen (5)
- # lumo (1)
- # monads (1)
- # off-topic (23)
- # onyx (49)
- # powderkeg (6)
- # re-frame (4)
- # reagent (8)
- # ring (3)
- # shadow-cljs (24)
- # specter (70)
- # sql (1)
- # unrepl (96)
- # yada (3)
Can someone help figure out what’s going on? I’m trying to experiment with lib-grimoire
in a repl, but I’m getting errors in a CIDER repl that don’t occur if I lein repl
in a terminal.
With lein repl
:
Neils-MBP:grimtest neilo$ lein repl
nREPL server started on port 61404 on host 127.0.0.1 -
REPL-y 0.3.7, nREPL 0.2.13
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_112-b16
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=> (load "grimtest/core")
nil
user=> (in-ns 'grimtest.core)
#namespace[grimtest.core]
grimtest.core=> (gt/->Group "org.clojure")
#g/t [:grimoire.things/group {:name "org.clojure", :grimoire.things/url "org.clojure"}]
grimtest.core=>
In a CIDER repl:
;; Connected to nREPL server -
;; CIDER 0.15.1 (London), nREPL 0.2.13
;; Clojure 1.8.0, Java 1.8.0_112
;; Docs: (doc function-name)
;; (find-doc part-of-name)
;; Source: (source function-name)
;; Javadoc: (javadoc java-object-or-class)
;; Exit: <C-c C-q>
;; Results: Stored in vars *1, *2, *3, an exception in *e;
;; ======================================================================
C-c C-k
to load grimtest/core.clj, and then C-c M-n
to switch namespaces
and then
grimtest.core> (gt/->Group "org.clojure")
AbstractMethodError Method guten_tag/core/ATaggedVal.iterator()Ljava/util/Iterator; is abstract guten-tag.core.ATaggedVal (core.clj:-1)
grimtest.core>
Same project.clj, same code, etc. What’s going on?
1.8.0_112-b16
And yes, nice to chat with you!
… “incomplete” in what way?
… even if that were so, why would the exception occur only in a CIDER repl?
I'm guessing that CIDER may be doing some code reloading, and since the ATaggedVal type is defined in Clojure that could mess things up.
@gonewest818 can you publish your scratch repo somewhere?
You can reconstruct the repo easily… it’s just lein new grimtest
(defproject grimtest "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url ""}
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure-grimoire/lib-grimoire "0.10.9"]])
and src/grimtest/core.clj
:
(ns grimtest.core
(:require [grimoire.api.web :as g]
[grimoire.things :as gt]))
Literally, that’s it.
I know, right?
;; Connected to nREPL server -
;; CIDER 0.15.1 (London), nREPL 0.2.12
;; Clojure 1.9.0, Java 1.8.0_144
;; Docs: (doc function-name)
;; (find-doc part-of-name)
;; Source: (source function-name)
;; Javadoc: (javadoc java-object-or-class)
;; Exit: <C-c C-q>
;; Results: Stored in vars *1, *2, *3, an exception in *e;
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: clojure.tools.analyzer.utils, being replaced by: #'clojure.tools.analyzer.utils/boolean?
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: clojure.tools.analyzer, being replaced by: #'clojure.tools.analyzer.utils/boolean?
user> (require '[grimoire.api.web :as g]
'[grimoire.things :as gt])
nil
user> (gt/group "foo")
CompilerException java.lang.RuntimeException: No such var: gt/group, compiling:(*cider-repl lib-grimoire*:15:7)
user> (gt/->group "foo")
IllegalArgumentException Multiple methods in multimethod 'simple-dispatch' match dispatch value: class guten_tag.core.ATaggedVal -> interface clojure.lang.IPersistentMap and interface clojure.lang.ISeq, and neither is preferred clojure.lang.MultiFn.findAndCacheBestMethod (MultiFn.java:178)
user>
and for the record: Emacs 25.3, CIDER 0.15.1, nrepl 0.2.13 and Java 1.8.0_112
@gonewest818 works on my machine?
;; Connected to nREPL server -
;; CIDER 0.15.1 (London), nREPL 0.2.12
;; Clojure 1.9.0, Java 1.8.0_144
;; Docs: (doc function-name)
;; (find-doc part-of-name)
;; Source: (source function-name)
;; Javadoc: (javadoc java-object-or-class)
;; Exit: <C-c C-q>
;; Results: Stored in vars *1, *2, *3, an exception in *e;
user> (gt/->Group "org.clojure")
#g/t [:grimoire.things/group {:name "org.clojure", :grimoire.things/url "org.clojure"}]
user> (gt/->group "org.clojure")
#g/t [:grimoire.things/group {:name "org.clojure"}]
user> (print (slurp "project.clj"))
(defproject me.arrdem/scratch "0.1.0-SNAPSHOT"
:description "Bits and bats. More bats than Detritus."
:url ""
:license {:name "Eclipse Public License"
:url ""}
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure-grimoire/lib-grimoire "0.10.9"]]
:profiles {:dev {:source-paths ["dev"]}})
nil
user>
;; Connected to nREPL server -
;; CIDER 0.15.1 (London), nREPL 0.2.12
;; Clojure 1.8.0, Java 1.8.0_144
;; Docs: (doc function-name)
;; (find-doc part-of-name)
;; Source: (source function-name)
;; Javadoc: (javadoc java-object-or-class)
;; Exit: <C-c C-q>
;; Results: Stored in vars *1, *2, *3, an exception in *e;
user> (gt/->Group "org.clojure")
#g/t [:grimoire.things/group {:name "org.clojure", :grimoire.things/url "org.clojure"}]
user> (gt/->group "org.clojure")
#g/t [:grimoire.things/group {:name "org.clojure"}]
user> (print (slurp "project.clj"))
(defproject me.arrdem/scratch "0.1.0-SNAPSHOT"
:description "Bits and bats. More bats than Detritus."
:url ""
:license {:name "Eclipse Public License"
:url ""}
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure-grimoire/lib-grimoire "0.10.9"]]
:profiles {:dev {:source-paths ["dev"]}})
nil
user>
I’ll try dropping back to nREPL 0.2.12, or upgrading Java to 1.8.0_144… ?
nREPL 0.2.12:
actually, yes
;; pretty printing (via fipp, the default)
(setq cider-repl-use-pretty-printing 't)
(setq cider-pprint-fn 'fipp)
So fipp sees that the guten-tag ATaggedVal is in theory java.lang.Iterable
and so tries to call .iterator
which isn't implemented and boom
Yep, that was it. (setq cider-repl-use-pretty-printing nil)
you'll have to depend on guten-tag explicitly to bump the depended version but it'll work
cool. thanks.
@gonewest818 can you throw me an issue http://github.com/arrdem/guten-tag
@gonewest818 [me.arrdem/guten-tag "0.1.7"]
done.
was afk for a few minutes… do you still need the issue?
ok, patch is confirmed, thanks!
Sorry about that, lemme know if you have any trouble with lib-grim or notice any particular design flaws.
I'm not working on it right now but it's high on my list once I circle back from trying to shave the doc writing yak.
ok, will do. The reason I’m looking at this is because of an earlier discussion in this channel. Someone asked if it would be possible to modify cider-grimoire.el
to read from a cached copy of the docs to make the lookups more responsive. bbatsov suggested doing that as nrepl middleware so that the same feature would be (at least in theory) accessible to atom and vim etc. And I thought I would have a try at that.
grimtest.core> (-> ""
grimoire.api.web/->Config
grimoire.api/list-groups)
IllegalArgumentException No method in multimethod '-list-groups' for dispatch value: :grimoire.api.web/Config clojure.lang.MultiFn.getFn (MultiFn.java:156)
[grimoire.api.web :as web]
you do have to require grimoire.api.web.read
for side-effects. sorry, web is just a couple ctors.
ah, got it.
thanks.
is it the case that one cannot (cider-debug-defun-at-point)
(i.e. instrument) core.async
code? and is the most up-to-date workaround ztellman's riddley[0]?
my context for this is this github issue: https://github.com/clojure-emacs/cider/issues/1775
[0] https://github.com/ztellman/riddley
@gonewest818 Happy to see you’re working on this!
@gonewest818 Really excited to see progress on this also!
starting a fresh 1.9 project. " $ lein repl " works fine. Updated cider. Get an error when doing 'cider-jack-in' Starting nREPL server via /home/bob/bin/lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.13\"\ \:exclusions\ \[org.clojure/clojure\]\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.16.0-SNAPSHOT\"\] -- with-profile +jetty repl... ... error in process filter: cider--connections-refresh: Invalid function: (buffer (get-buffer cider--connection-browser-buffer-name)) error in process filter: Invalid function: (buffer (get-buffer cider--connection-browser-buffer-name))
This was because I was running cider from "melpa" (aka cider 20171220.135) and not "stable.melpa" (aka cider 0.15.1).
Hmm, 0.16 works for me just fine. Normally you’d get such an error if there was some issue on the Elisp side of things. You can also toggle nREPL message logging in CIDER and try to connect again to see what’s happening in the log.
Meanwhile, progress on some docs-as-data ideas https://twitter.com/arrdem/status/944294272496410625
@bherrmann That’s a pretty common scenario. 😄