This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-20
Channels
- # beginners (17)
- # boot (19)
- # chestnut (1)
- # cider (25)
- # clara (1)
- # cljs-dev (15)
- # cljsrn (10)
- # clojars (9)
- # clojure (182)
- # clojure-brasil (27)
- # clojure-dusseldorf (2)
- # clojure-gamedev (5)
- # clojure-germany (1)
- # clojure-greece (2)
- # clojure-italy (18)
- # clojure-poland (5)
- # clojure-romania (3)
- # clojure-russia (29)
- # clojure-serbia (6)
- # clojure-spec (9)
- # clojure-uk (77)
- # clojure-ukraine (1)
- # clojurescript (61)
- # cursive (5)
- # datomic (20)
- # defnpodcast (1)
- # emacs (10)
- # fulcro (2)
- # graphql (2)
- # hoplon (11)
- # lumo (4)
- # off-topic (50)
- # om (3)
- # onyx (26)
- # other-languages (39)
- # parinfer (2)
- # pedestal (5)
- # re-frame (32)
- # reagent (48)
- # rum (7)
- # shadow-cljs (10)
- # spacemacs (29)
- # sql (10)
- # unrepl (58)
- # vim (3)
Hey there; I’m a Clojure newbie doing some http://Exercism.io problems in Spacemacs. Does anyone have any advice on getting the Cider REPL to work for these exercises? I can’t seem to get the REPL to use the right namespace; I get “undefined” errors when trying to run my functions.
@thomas.armstrong depending on your workflow you can also use cider-repl-set-ns
(C-c M-n) to set the REPL namespace to the namespace of the current buffer.
I usually work only in namespace buffer (the actual file with code) and eval either the whole buffer or expressions one by one. That way, it should always work. Sometimes, I want to send expression to the REPL (for better "visualization" of result) - then I need to make sure that REPL has proper namespace (C-c M-n) and just call cider-send-last-sexp-to-repl
(`,s e` using Spacemacs in evil mode)
@grzm Hey, thanks for getting back to me. I tried that, and it works. Was hoping to get it to work without needing to require the ns first, but whatever works 🙂
@jumar Yes, I had found that command; not sure what I was doing wrong before, but it seems to work now. Thanks, though!
@thomas.armstrong No problem. require
loads the file. Code isn't automatically loaded at the repl.
hi all, I'm working with a Dockerized dev environment - See: http://danlebrero.com/2017/09/25/how-do-docker-compose-development-environement
there is a container with the Clojure code and an nREPL server running, I can connect from my host machine using cider-connect
(meta #'akvo.lumen.lib.collection/all) {:arglists ([tenant-conn]), :line 5, :column 1, :file "akvo/lumen/lib/collection.clj", :name all, :ns #namespace[akvo.lumen.lib.collection]}
if i evaluate the file(Ctrl + c , Ctrl + k), the vars get redefined, the metadata gets changed to absolute paths and the jump to definition works again
is this considered a bug? can i workaround this issue without evaluating the target namespace ?
@iperdomo I think cider resolves the metadata to an absolute path for you, but that absolute path is the one inside the docker container.
Someone once told me there was a trick to have emacs rewrite the path using some built-in emacs feature (maybe tramp?) but I don't know what it is.
hey @dominicm ... I've been reading about tramp but it feels that i'm adding more complexity to the whole thing
I wonder if this solves the problem? https://github.com/emacs-pe/docker-tramp.el
https://www.gnu.org/software/emacs/manual/html_node/emacs/File-Aliases.html#File-Aliases this might also work?
What about mounting the source dir in the docker container using the same absolute path that occurs on the outside? You’d have to customize the docker-compose.yml per developer, or possibly use environment variable substitution to generalize it.