This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-12
Channels
- # announcements (1)
- # babashka (124)
- # beginners (98)
- # calva (54)
- # cider (32)
- # cljdoc (5)
- # cljs-dev (131)
- # cljsrn (1)
- # clojure (107)
- # clojure-australia (2)
- # clojure-europe (2)
- # clojure-losangeles (1)
- # clojure-norway (3)
- # clojure-uk (28)
- # clojurescript (21)
- # conjure (86)
- # core-async (7)
- # cursive (3)
- # datascript (5)
- # datomic (28)
- # defnpodcast (2)
- # devcards (1)
- # exercism (47)
- # fulcro (22)
- # graalvm (29)
- # graphql (1)
- # malli (5)
- # nrepl (31)
- # off-topic (111)
- # re-frame (23)
- # reitit (4)
- # spacemacs (6)
- # tools-deps (10)
- # tree-sitter (1)
- # xtdb (6)
Assuming it’s company - see https://github.com/company-mode/company-mode/wiki/Writing-backends
I think I was asking a bit about that choice. Do I have to pick a backend, like go with company, auto-complete or completion.el. There's not a way to create generic completion that all of them would be able to leverage?
How do you deal with environmental variables? Some of my code uses them, and I want them to be available in repl. I can set them in my .zshenv file, it gets picked up by the repl, but it's not the best solution since I want to save the environmental variables per project. Also I don't want some of them (like api keys) to get under source control.
It was discussed a few times to add provisions to CIDER about them, but we never got to doing so. I’m guessing one simple solution to prepend them to the jack-in command.
And also https://www.gnu.org/software/emacs/manual/html_node/elisp/System-Environment.html I’m guessing you can just set process-environment
via .dir-locals.el.
Can someone describe the refactoring process using cider? I have a project which I originally created with lein. Even though I'm not ready to announce it publically I would appreciate if someone could explain how to perform the refactoring. Currently all the functions are defined in one file, and I'd like to split them among different files, grouping functions together which work together.
For example, suppose all the functions have been loaded into VM, and I can run the tests at the cider repl. What do I need to do to move a function from one file to another?
One error that I get when i try this is the following:
That looks like an aliasing issue in the test ns. You need either unalias, refresh (tools.namespace) or restart repl
clj-refactor unfortunatly does not help. Those functions are broken. I've created an issue in github, and they're working on the issues.
Are you suggesting that to move a function from one file to another I need to restart the repl?
Please tell me what you mean by unalias. I don't know what that is nor how to use it.
Is there a cider way to do the unalias? e.g. point to the offending symbol in the stacktrace and exec an emacs function ???
BTW, how should I restart the repl? In slime, there is the emacs function slime-restart-inferior-lisp
...
I don't find the function cider-jack-out
which one might guess generalizing from cider-jack-in
I get this error when trying to move several function definitions from file core.clj
whose namespace is
(ns clojure-rte.core
(:require [clojure.set :refer [union intersection]]
[clojure.pprint :refer [cl-format]]
[clojure-rte.cl-compat :refer [cl-cond cl-prog1 cl-prog2 cl-progn]]
)
(:gen-class))
to file rte_tester.clj
whose name space is
(ns clojure-rte.rte-tester
(:require [clojure-rte.tester :refer [simplify random-test]]
[clojure-rte.core :refer []]
))
How should I restart the repl? In slime, there is the emacs function `slime-restart-inferior-lisp` ...
I don't find the function `cider-jack-out` which one might guess generalizing from `cider-jack-in`
@jimka.issy I find most cider commands easily discoverable with M-x cider
if you have a completion framework like helm or ivy (`SPC SPC cider` in Spacemacs)
• To unevaluate a function, cider-undef
• To refresh the namespace, cider-ns-refresh
• To restart the repl, cider-restat
or cider-quit
followed by ckder-jack-in
I use comment sections when I am developing code that groups my code logically, making it quite obvious when to split code off to another namespace. If doing just one function I will use cider-undef
, if multiple functions I'll just restart my repl and evaluate the main namespace cider-eval-buffer
, as this then helps check I have put all the definitions in order (as Clojure is a one pass parser, so def, defn should be used before using those names)
I am more used to using the Emacs tools to refactor code now, https://practicalli.github.io/spacemacs/refactor/ as I can use them across multiple languages
I don't find cider-def
when I type that in the M-x minibuffer I see the following.
sorry, typo. updated the original post
that helps. thanks.
ouch! it's painful
Is there an idiomatic name to name a local function whose purpose it is to do a recursion similar to loop/recur ?
seems like a question best asked in the #beginners channel 🙂