This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-27
Channels
- # beginners (80)
- # boot (5)
- # cider (4)
- # cljsrn (3)
- # clojure (83)
- # clojure-russia (1)
- # clojure-spec (15)
- # clojurescript (20)
- # community-development (8)
- # cursive (6)
- # emacs (5)
- # fulcro (14)
- # hoplon (71)
- # off-topic (6)
- # om (2)
- # onyx (33)
- # parinfer (3)
- # re-frame (21)
- # reagent (20)
- # spacemacs (2)
- # specter (4)
- # vim (8)
I see a ton of resources for learning clojure so I’m a bit lost on where to start… is there one in particular that’s recommended for people who already know fp in other languages and have a basic understanding of lisp?
http://4clojure.com has some good exercises, and when you solve them you can see other people's solutions
@automattable and for books, Joy of Clojure is perfect for someone coming from ML or Common Lisp and learning Clojure
@automattable Have you worked on the JVM before? If not, that's probably going to be the biggest shift coming from Haskell, other than Clojure having no type system 🙂
tbh, I’m expecting strict evaluation to be the thing that takes me longer to get used to
Folks coming from non-JVM languages sometimes seem to struggle with tooling, classpaths, stacktraces etc.
And especially when you have lazy sequences in play 🙂 (re: your comment about strict evaluation)
I personally feel the stacktraces aren't as bad as some people make out -- I think there are some heuristics you can quickly pick up to help ignore the "noise" in the stack traces.
This is a good talk to watch about one of the unique aspects of Clojure https://vimeo.com/223309989
is there a good way to apply a vector of functions to corresponding members of a vector of values? i’m looking for
(f [inc dec square] [1 2 3])
> [2 1 9]
is there an easier way to do
(map #(map (fn [f v] (f v)) [inc dec] %) [[1 2] [3 4]])
> ((2 1) (4 3))
but to end up with something first class, you need to wrap it in a function, so you might as well embed (f x)
instead of (.invoke f x)
but now i’m just trying to map a function over the second item in each tuple in a vector
@jakeb I'm wondering if a reduce
statement is a better fit for your scenario, but I'm not in a position to fully flesh out the options
I would like to use something like this (take 3 (iterate plus now (days 1)))
, that I found on the website https://github.com/dm3/clojure.java-time#an-appetizer
it says ArityException Wrong number of args (3) passed to: core/iterate clojure.lang.AFn.throwArity (AFn.java:429)
Too many or too few? The error message only tells you that there are a 'wrong number'.
says ClassCastException java.time.LocalDate cannot be cast to java.time.temporal.TemporalAmount java-time.temporal/t-plus (temporal.clj:293)
so
(into {} [(vector 1 90)])
> {1 90}
(into {} [(list 1 90)])
> ClassCastException java.lang.Long cannot be cast to java.util.Map$Entry
vectors are interpreted as key/value pairs. notice:
user=> (seq {:a :a :b :b})
([:a :a] [:b :b])