This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-22
Channels
- # beginners (143)
- # boot (18)
- # chestnut (5)
- # clara (1)
- # cljs-experience (1)
- # cljsrn (13)
- # clojure (290)
- # clojure-austin (4)
- # clojure-italy (13)
- # clojure-nl (21)
- # clojure-russia (14)
- # clojure-spec (49)
- # clojure-uk (59)
- # clojurebridge (7)
- # clojurescript (54)
- # core-logic (2)
- # cursive (22)
- # datomic (149)
- # fulcro (31)
- # graphql (14)
- # hoplon (59)
- # keechma (24)
- # lambdaisland (1)
- # lumo (86)
- # off-topic (3)
- # om (19)
- # om-next (1)
- # onyx (4)
- # portkey (20)
- # re-frame (41)
- # reagent (63)
- # ring (1)
- # ring-swagger (1)
- # spacemacs (9)
- # sql (10)
- # yada (13)
This fails if coll contains nil or false.
#(= (set/intersection coll %) %)
my only thought is my route composition is off but i don't know how to do it differently i guess
in particular, https://clojuredocs.org/clojure.set/subset_q
figured it out. if you want to serve some json, don't forget to wrap your payload in the response
function
Hello! I'm just starting out with Clojure, following along with the http://braveclojure.com tutorial. I've mostly used vim as my editor before (10+ years), and never written any lisp at all, nor have I tried Emacs for more than a few minutes. Manually setting up all the vim plugins and config seems a bit daunting and distracting from my actual goal of learning some Clojure. Any advice as to how to get up and running smoothly?
Some would advise using a beginner-oriented editor while youāre learning. This seems like a decent list: https://cb.codes/what-editor-ide-to-use-for-clojure/
@emilaasa Iām using Vim with https://github.com/bhurlow/vim-parinfer and itās all I need
It seems like thereās a #vim-fireplace room here and they might be helpful in guiding you
@emilaasa Also a vim user here~ š Here's the plugins I'm using now:
guns/vim-clojure-static
kien/rainbow_parentheses.vim
tpope/vim-classpath
tpope/vim-fireplace
oh right, https://github.com/tpope/vim-surround is an absolute must as well
paredit for me. i don't type closing parens and i get structural editing. it's a necessity
I've attempted to first perfectly configure my vim for the language I've wanted to learn a few times in my life. Usually ended up learning more about how to totally demolish a .vimrc than any actual programming.
Yep I think I will do that, atleast I know there is some pretty big quality of life things I should sort out eventually, namely repl connection, something with balancing parens (?) and editing s-expressions
I don't type closing because they are inserted for me when i enter a pair. I kill inside of a sexp so i maintain the invariant of balanced parens
i can't imagine writing a lisp without some type of structural editing capability. also, emacs has a show matching paren that is invaluable to me
I use ProtoREPL (Atom) and Parinfer -- hated Parinfer at first but forced myself to get used to it and now I absolutely love it! Also have the lisp-paredit package installed for structural stuff and indentation.
Anyone worked thru a book or tutorial that they can recommend? I'll probably run thru the basics, and then try rewriting a small web service (Java Servlet API) in Clojure as a practice project at work, if that narrows down the preferences at all
i like using Atom as well, but i'm coming from JS/front end land, so it's what i know. i've been working through Living Clojure by Carin Meier and really like it. it's workbook-like rather than a reference.
@emilaasa What have you looked at so far? Clojure from the Ground Up? Clojure for the Brave and True?
Yeah, I've heard good things about Living Clojure.
Brave and True is where i started and it was good for getting on the ground running.
I'd expect the Clojure Cookbook and Clojure Applied to be good follow-on books, if you like stuff focused on real-world problems and solutions.
Clojure Programming was recommended to me as the follow up, so i've got that as well.
Iāll add a totally unbiased plug for Programming Clojure, 3rd edition, which is available in beta (but with all of the text available as of about an hour ago)
but also I recommend all of those books listed too
to second Alex's recommendation, I've bought that for myself and a coworker at my former company. really excellent book.
Well an author that shows up in the #beginners slack channel is alright in my book, ordering now š
it brushes up against a good bit of java, some of the more bedrock classes, which is extremely helpful for people like me who do not know the java ecosystem
My first Clojure book was The Joy of Clojure but I wouldn't recommend that unless you already have some FP and some Lisp background. My second book was Clojure Programming (Emerick et al).
I've only done Haskell and done my best to keep the companys JS code as functional as possible š
JS always makes me want to jump our of a window š
Overall, re: Clojure books, there's a lot of good ones out there and only a few duds so you mostly can't go wrong with whatever anyone recommends.
in the reverse, the stuff i've learned in clojure has made picking up the changes in ES6 smoother.
I have a couple of sample chapters from the original Programming Clojure book and it looked fine but at the time it was using an outdated version of Clojure so I picked (several) others. Now it's been updated and a third edition is coming out, that's going to be one of the most up-to-date books.
I bought Clojure in Action early on and it was written for Clojure 1.2 but not released until 1.3 was out so a lot of it was broken by that, unfortunately (I pleaded with Manning to have the author update it before release but they pushed it to market anyway).
Thanks everyone by the way for being super helpful! These first hours in #beginners can really make a difference for how you feel about a language/community and you all are making it feel great! š
PC 2nd ed was written against Clojure 1.3, but newest is targeted at 1.9
btw, I am currently seeking a few reviewers for Programming Clojure! having some beginner(-ish) people would be great
ping me in dm if youāre interested (free copy of the ebook included). heck, Iāll even send you a physical copy at my expense if the publisher doesnāt (canāt remember right now)
I think PC 1st ed was written against 1.1 wasn't it @alexmiller ?
(almost prehistory in Clojure terms now š )
I just looked at Clojure in Action 2nd Ed (which I also have) and that was written against 1.6 so it doesn't cover some important recent features.
I want to say it was 1.0 actually
Before protocols? I'm trying to remember what was added in 1.1... Hard to believe how much the language has moved on since then -- but also incredible how stable and backward-compatible it has remained.
For folks new to Clojure like @emilaasa I'll say: don't be afraid to try the very latest alpha features when learning Clojure (`clojure.spec` is incredible in 1.9 Alpha 17!) -- ever since my company adopted Clojure, we've been going to production on Alpha versions with huge success (our first Clojure launch used 1.3 Alpha 7 or Alpha 8 -- and we've been on 1.9 Alpha 17 in production for a while now!).
Clojure != JavaScript š
One of my favorite newish languages is Elm which is notoriously slow to implement anything, very deliberate and thought through.
almost nothing (other than the new spec) is still marked alpha
yes, that and clojure.reflect
Is clojure.reflect
consciously marked as alpha because it might change, or because it was never fully fleshed out in the first place and never got worked on again?
the alpha tag was consciously not removed from clojure.reflect in 1.6 (when we removed it in most other places) because it is still subject to change
so yes, that is deliberate
Iām not sure anyone ever actually uses it :) one of the reflectors is actually broken in JDK 8 and no one has ever mentioned it
will be fixed when we remove support for jdk 6 and update asm next
nah, just talking about core
*compiler-options*
is also marked as alpha, but I donāt think for any good reason
It would be nice to have some form of (parallel) fold in core -- I had hoped we'd see that with transducers (but haven't thought that through to see whether it's even a sane hope). The reducers library feels like a bit of a dead end now: it appeared, never seemed to get much traction, and mostly feels overtaken by transducers. /cc @alexmiller
I would say that reducers is effectively deprecated (but does still have unique utility). there are no plans to (ever) remove the namespace.
Always accretion... š
and I expect that eventually the ideas of fold will evolve into something - itās an important use case and will only grow more so
Since this is #beginner, I'd say reducers are easier to grok then transducers, so lazy-sequence -> reducers -> transducers is a good small increment steps to learning
I find transducers to be easier to both use and implement actually :)
I agree on "use". Not sure I agree on "implement". I'm still a little hazy on when/how the zero-arity version is invoked.
hey does anyone know how to show docs in the Proto-repl?
Iām about to go to a job interview and havenāt used clojure for a while. Iām planning on using it for the code challengesā¦ never done this before so Iām kinda freaking out haha.
ctl-alt , d
(when you're on a symbol and have a REPL running)
do I have to be in REPL? not file?
In the file, but have a REPL running.
It uses the REPL to run the code to look up the docs.
oh got it
I was missing the comma
If you bring up the command palette (cmd-shift-p on a mac, can't remember on windows) you can just type documentation
and see all the keymappings
cool I think I should be alright now. I was planning on using Racket but I think Iāll be more confident with Clojure
So cmd-opt-d works on a mac as well, and ctl-, d should also work
I was just doing ctrl-alt d
without comma and it was deleting up to that point
thank you!
If in doubt, start from the command palette and it'll show the keyboard shortcuts.
And BTW there's a #protorepl channel, if you're not already a member @grounded_sage
Cheers. Yea I started using Atom because I wanted to use Parinfer. Was using Spacemacs before hand. Proto repl is definitely cool. Still unsure whether switching to Atom was best decision. Time will tell I guess
I've been doing a lot of Elm and Elixir recently. Miss the lisp repl
I used Emacs way back (in the 17.x/18.x days) then found my way back to it after getting into Clojure and used it heavily again for a couple of years. I switched completely to ProtoREPL after Conj last year and I do not regret that change.
It depends entirely on how much of CIDER's rich functionality you are used to in your daily workflow.
Your choice is more likely to depend on whether you prefer Emacs or Atom as your core editor.
One feature of CIDER that I missed at first with ProtoREPL was the ability to have multiple REPLs open but I've adjusted my workflow to where that's no longer an issue.
I get people who are behind emacs, but if there was one and only one thing that I believe hurts Clojure adoption with beginners, its emacs. I wonder how much emacs has hurt lisps over the years even in terms of widespread adoption. If the language won't be familiar, at the very least having the editor be familiar would be nice. Proto-repl I think is leading the way in that direction.
fwiw, Cursive supports paredit and parinfer, is a lot more stable/mature than atom, almost as feature-complete as emacs for clojure dev, and is quite newbie friendly
@bfabry I think the deciding factor there is whether you want an IDE (IntelliJ/Cursive) or an editor (Atom/ProtoREPL).
I could never grow to like IntelliJ back when I was using IDEs -- I tried a lot of different versions and just don't like the UI. I used Eclipse in preference (although I never really liked Eclipse either). For a while, with Clojure, I used Eclipse/CCW.
Iāve never used a āproject modeā in vim fwiw
(and itās my main editor)
are you sure? if you opened a ruby project and you had one of the "normal" ruby plugins you were
I donāt open projects
I open files
I used vim exclusively as a ruby developer for like... 6 years? and I don't really feel much difference between it and emacs for clojure or cursive for clojure
sure - but I donāt have anything in vim that even knows what a āprojectā is - it could be that many vim or emacs users are using the right extensions to have an IDE, but I donāt think itās universal.
cwd in vim was pretty much my equivalent to project. not everyone uses it that way, though it's certainly very common
if cwd is a project, ed is an ide