This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-27
Channels
- # beginners (91)
- # cider (1)
- # cljsjs (29)
- # cljsrn (8)
- # clojure (51)
- # clojure-berlin (1)
- # clojure-india (1)
- # clojure-russia (26)
- # clojure-spec (15)
- # clojure-uk (1)
- # clojurebridge (1)
- # clojurescript (240)
- # code-reviews (1)
- # cursive (22)
- # datomic (3)
- # editors (6)
- # emacs (24)
- # figwheel (3)
- # lein-figwheel (57)
- # off-topic (4)
- # om (3)
- # proto-repl (7)
- # protorepl (8)
- # reagent (2)
- # rum (23)
- # slack-help (1)
- # spacemacs (2)
hey guys, i need a bit of feedback on how to best approach a problem i'm trying to solve
so, basically, i'm writing a library that should accept a value (typically a map) that can have nested functions
what would be my best approach to handling this ? i'm feeling like eval
is not my best option here, since it probably allows way too much logic -- but i'm not sure
so, e.g., {:foo :bar}
would be a perfect value to pass to this library, but so are (fn [] {:foo :bar})
or [:foo {:bar (fn [] :wombat)}]
which would return {:foo :bar}
and [:foo {:bar :wombat}]
respectively
well, i ended up doing this:
(postwalk (fn [x] (if (function? x) (x) x)) data)
which is probably the most appropriate solution herefollowing the https://github.com/bhauman/lein-figwheel/wiki/Quick-Start results in Figwheel Server: Resource not found
how does it work with clojure? I have to use something in CLI, so either vim or spacemacs. i tried nvim-parinfer and it was unusable, probably someone who is familiar with the situation can resolve it, but I couldn't
@ashnur check this out, it’s for Atom but it will get let you start smoothly https://atom.io/packages/proto-repl
for 2 days i am asking for help, and the first person who responds doesn't even read the question
@ashconnor I think most of the developers do not use spacemacs but atom or cursive
ok, so you are telling me that if i have this limitation i should just give up, because there are no ways ahead
@ashnur I don't use emacs anymore but Cursive, can I ask the reason behind "I have to use something in the CLI"?
I ask, because you could use more beginner friendly editors, and connect to a remote REPL (if that is the reason you need to use the CLI)
nah, it's just next room, but where i live now has no place for a table, so i can't use that machine because no place to put the monitor and the keyboard, i mean i tried but my back got hurt from the awkward position
do i really have to tell you my life story to believe when i say i have to it's not a "i think i might have to but actually i am stupid, please decide for me"
i see the try to make me be like you part, and i believe that you believe that would be helpful for me
oke, then I hope you get help from another person. I agree with rauh that #editors or #emacs you can get help sooner as here
@ashnur I haven't used it personally, but I hear spacemacs is a great match for Clojure. Check out vim-fireplace as well if you like vim.
@ashnur: I use spacemacs. It has a clojure layer that works pretty fine right from the get-go, hasn't required much setup (though I usually don't use a repl in-editor), and has all the basics down (code highlighting, autocomplete, paredit functionality etc.) All I've done by way of setup is add the clojure, evil-cleverparens, and auto-completion layers and then in my user config:
(spacemacs/toggle-evil-cleverparens-on)
(add-hook 'clojure-mode-hook #'evil-cleverparens-mode)
(setq cider-show-error-buffer nil)
(with-eval-after-load 'clojure-mode
(dolist (c (string-to-list ":_-?!#*"))
(modify-syntax-entry c "w" clojure-mode-syntax-table )))
@ashnur Did you resolve your figwheel issue? I'm not at my computer so I'm afraid I can't give any better help than "it worked for me"... There is a #lein-figwheel channel as well that the author of figwheel checks from time to time.
I think some people add parinfer to their spacemacs config too as a separate package. (I don't much like parinfer myself, so I've not tried. Spacemacs has baked in parens matching, rainbow parens, and lisp editing mode with slurp and such, plus the clojure mode indenting is awesome; those are quite enough for me)
Hi all. Trying to get protorepl working with a reframe project. Would like to enable the auto eval file option, when I do I get a bunch of warnings though. Showing errors on things like enable console print. Any tips?
@dorianc.b Thank you. Are you able to auto eval cljs files? I was able to run clojure without errors, but I get these errors with the cljs
@aramz oh my apologies I misread I didn’t realize you meant cljs. I also get the same error. When I start proto-repl it does state that it is unsupported. You can ask the developer of proto-repl in the proto-repl channel
@dorianc.b I think it is limited, but what I have been trying to figure out is how can I connect to a remote repl
trouble is I don’t understand how to start a remote repl that will eval the forms and load the ns etc
I can interact via the command line, but I don’t see a repl address and port to connect to via proto-repl
oke, I was thinking of using it locally on Linux but maybe I have to look for another one
@aramz piggieback etc is all complicated (to me:P), to get up and running with atom, create a new chestnut project because it's going to give you all the things you need to connect to figwheel over nrepl.
lein new chestnut my-project
cd my-project
lein repl
that's gonna kick you into the user
namespace which is the stuff in dev/user
there are functions in there you use, but before that grab the nrepl port number that was outputted from lein repl
At this point you want to switch to atom and connect to the nrepl instance using repl-lite
, do that with the shortcut ctrl+r (let go) r
input the nrepl port into the text box (this text box is absolute shit for some reason) and hit return. this should kick you into the user namespace
now type (run)
and with your cursor on the closing paren, hit ctrl+r (let go) i
this is the shortcut to eval a sexp, this will start figwheel
once that's done, boot the browser repl with (browser-repl)
if you want to evaluate a block or a variable, you highlight the thing and do ctrl+r (let go) j
Hopefully, I’m still just in the early stages, so even just running figwheel is already on par with all my other tools, but the auto eval in proto-repl is just so amazing and of course eval a block.
running figwheel from the repl via lein repl
is def the way to go as far as nrepl and figwheel are concerned