This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-30
Channels
- # bangalore-clj (1)
- # beginners (23)
- # boot (1)
- # cider (23)
- # cljsjs (2)
- # cljsrn (4)
- # clojure (251)
- # clojure-dusseldorf (2)
- # clojure-gamedev (23)
- # clojure-italy (5)
- # clojure-russia (53)
- # clojure-sanfrancisco (5)
- # clojure-spec (7)
- # clojure-uk (66)
- # clojurescript (169)
- # community-development (21)
- # core-async (10)
- # cursive (15)
- # data-science (1)
- # datomic (7)
- # docker (1)
- # emacs (24)
- # events (1)
- # funcool (6)
- # hoplon (24)
- # liberator (1)
- # luminus (6)
- # lumo (62)
- # mount (7)
- # off-topic (1)
- # om (12)
- # om-next (5)
- # onyx (14)
- # overtone (2)
- # pedestal (58)
- # powderkeg (27)
- # protorepl (1)
- # re-frame (1)
- # ring-swagger (16)
- # rum (51)
- # spacemacs (25)
- # uncomplicate (7)
- # unrepl (22)
- # untangled (7)
- # yada (109)
Was just doing a quick search for when-first
on github, I assume this usage is not doing what he thinks it should be:
(when-first [resource [(io/resource "config/config.private.edn")
(io/resource "config/config.default.edn")]]
(defconfig config resource))
hmm, trouble with or there is it wants a seq, remove nil? wld do, but it would look ugly
@shan Yeah, that's essentially:
(let [xs (seq resources)]
(when xs
(let [resource (first xs)]
(defconfig config resource))))
Which never looks after the first element. The goal was probably the single liner: (defconfig config (some identity resources))
I don't really see what the use of when-first
is - when would it be actually useful? Rather than just obfuscation?
i also like as->
Well, it isn't correct if you want to say "get the first thing off this sequence if it exists"
I think it's there to essentially avoid the noisy repetition in (when (first xs) (let [head (first xs)] head))
i still hate the giant clojure.core
namespace @thomas ... stockholm syndrome has never set in
it translates to (let [temp (first xs)] (when temp (let [head temp] ... do stuff with head ...))
I definitely think there'd be value in an occasional prune of these functions - when-first
is no juxt
🙂
yes, usage of juxt
is rare, but when you need it it's just the ticket!
I think the only time the size of clojure.core annoys me is when I'm trying to name something and discover that all the short names have been taken.
i find two things about clojure.core
- it makes learning clojure harder, because it's hard to browse related fns and it buries many functions like when-first
or (i discovered a few days ago) keep
yeah - discoverability is an issue for sure
but on the flip side, having so many core functions that operate over the sequence abstraction is part of what makes the language awesome
although personally I'd happily live without when-first
I think maybe a "core-function-of-the-day" plugin could be useful, based on the functions you haven't used in your codebase
@peterwestmacott or that looks at your github pages and decides based on that
I found having https://jafingerhut.github.io/cheatsheet/grimoire/cheatsheet-tiptip-cdocs-summary.html permanently open on a browser tab helped...
Once you know a number of them, they become vital. I'm close to building a rosetta stone of "how do I do these things in Java8" so I can solve a problem in clojure in my head, and then translate it into some horrible stream-based mess...
Anyone watch Tim Baldridge's talk at Clojure/West on Core.Async in Use yet? He is really succinct in his presentation
Feels like the takeaway is very much paralleled with what @agile_geek has been talking about with focus more around design decisions than the finer details of the written code
Big fan of @tbaldridge, His Youtube channel is worth a subscribe
Just subscribed 😄
I'm very tempted (even though I'm nearly falling asleep on my feet at the moment)
Interpreted by baby as "blah blah blah bla... ... ... ... 😴"
@korny How old is your little one now?