This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-02
Channels
- # admin-announcements (4)
- # aleph (10)
- # arachne (1)
- # beginners (66)
- # boot (19)
- # cider (6)
- # cljs-edn (2)
- # cljs-site (32)
- # cljsjs (4)
- # cljsrn (32)
- # clojure (116)
- # clojure-austin (6)
- # clojure-belgium (2)
- # clojure-dusseldorf (1)
- # clojure-russia (16)
- # clojure-uk (5)
- # clojurescript (178)
- # community-development (2)
- # cursive (28)
- # datascript (16)
- # datomic (16)
- # dirac (13)
- # editors (2)
- # emacs (1)
- # error-message-catalog (30)
- # events (3)
- # garden (2)
- # hoplon (27)
- # jobs (4)
- # ldnclj (4)
- # liberator (3)
- # off-topic (6)
- # om (49)
- # onyx (24)
- # parinfer (9)
- # re-frame (59)
- # reagent (46)
- # remote-jobs (1)
- # rethinkdb (4)
- # rum (2)
- # slack-help (11)
- # untangled (13)
hi, can anyone tell me where i can find uptodate article about configuring emacs for clojure, maybe 2016 year?
@agi_underground: I've been working on a beginners guide for Emacs that's "modern", i.e. uses ELPA/MELPA and use-package
you can find the work in progress here http://emacs-berlin.org/curriculum.html
if you copy the code in this section http://emacs-berlin.org/curriculum.html#sec-4-1
and then the setup code for Clojure http://emacs-berlin.org/curriculum.html#sec-4-4-4
The main thing is to get CIDER from MELPA, that's enough to have a working setup, so if you already have MELPA configured that can be as simple as M-x package-install cider
After that I highly recommend some structural editing mode. Paredit is a good default. Alternatives are smartparens and parinfer
@plexus: Thank you, article look nice, i hope it will be helpful for me!
@agi_underground @plexus I’m not the expert, but isn’t the Emacs LIVE a good and “modern” option for hacking Clojure in Emacs while still being accessible for beginners?
Emacs Live is woefully unmaintained, and is so idiosyncratic that I would not recommend using it.
You'll be inheriting someone else's large and convoluted config, and spend a lot of time just figuring out. It comes with its own packaging/config system which nobody else uses.
If you aim to do live performances with Overtone then maybe there's still a value proposition for Emacs Live. For general dev I don't think it's a great starting point though.
what is the idiomatic way to map into a vector?
@bojan.matic: are you looking for mapv
?
i'm making a reagent component, and want to render a list of things
reagent components are represented as vectors
the todomvc uses a for
as seen here
is that the recommended way to go?
if i wanted to do some data transformations and filters, what could i use then? or do i filter the data externally, then just use for in the render function?
or you can just use map and filter. It really depends on the specific case which version looks better. Both are totally valid.
can i get the index while doing for?
i need to create a unique key for every item in the list
you might look at https://clojuredocs.org/clojure.core/map-indexed
thanks, already found it
so i'm on the right track then
how do you return a hash-map literal from a shorthand function
(map-indexed #({:index %1 :item %2}) [1 2 3])
throws an Invalid arity: 1 error
using (map-indexed (fn [index value] {:index index :item value}) [1 2 3])
, works
And i think the problem is that the former one is equivalent to calling ({:index 0 :item 1})
@bojan.matic: reason here is that #()
treats its contents as something to call, i.e. what you wrote is the equivalent of (fn [idx val] ({:index idx :item val}))
, note the extra set of parens. So it's trying to do (your-new-map)
, which needs an argument. You just mean for the function to return the map itself, which #()
won't do
@agi_underground: I recommend spacemacs
@agi_underground @jwm spacemacs seconded. the file linked in this chapter might also be useful: http://www.braveclojure.com/basic-emacs/
i`m again here) Need yours advice, which book about clojure (again uptodate) most useful for beginner, who junior level, and have some knowledge in programming, but don`t know clojure language, and want fast as possible start to code web-app? I already was read "Web development with clojure by Dmitri Sotnikov".
@agi_underground: I just finished “Clojure for the Brave and True” and thought it was great.
I bought it, but I think the whole thing is online at http://www.braveclojure.com/
@lucaska: you think this book has all about clojure syntax and most general clojure way things?
Clojure syntax is pretty simple though, and it goes into the more advanced topics too. Plus it’s a pretty fun book.
@lucaska: and i intresting in how march time you spend with reading this book?
@lucaska: ok, thank you!
Having trouble picturing this one: Paging through results from a REST API and accumulating the results. For example the api might respond {:data [...] :page 1 :pages-available 5}
. Which means we are looking at :data
for page 1, and we have 4 more pages to get. On each one all we care about are all the values inside :data
. Is this a job for anything lazy? Or loop? Or reducing somehow?