I love clojure, and dream of the day I can work with it. But do you know why more people get into ruby or js? It's community is beginner friendly. Most texts on the subject of lisps feel like wannabe dissertations, preferably with the Computer Modern font and 5 pages long.
Clojure Distilled
31–40 of 54 posts
Re: Clojure Distilled
#32Earlier quoted context omitted.
I will say that cider has done a very nice job of getting interactive development using Emacs to work well. I am a 20+ year Emacs user and love working with Clojure via cider. I will say that I think getting started with Light Table is a great way to start, but don't leave Emacs too far behind! Good luck go you!
I also am a long time emacs user, but whenever a plugin freezes emacs I immediately stop using it. Is is cider now stable? I know nrepl.el would crash emacs frequently if you asked it to evaluate the wrong thing.
Re: Clojure Distilled
#33I love clojure, and dream of the day I can work with it. But do you know why more people get into ruby or js? It's community is beginner friendly. Most texts on the subject of lisps feel like wannabe dissertations, preferably with the Computer Modern font and 5 pages long.
I would never suggest a programmer learn Clojure as their first language, because of the enormous Java stacktraces. Then there's the setup involved (Java, usually Leiningen) to get to "Hello, World" compared to Python or Ruby. Just too many places where the student can get seriously stuck. Clojure's strengths (immutable structures, expression freedom, macros, Java interop, JVM) are not relevant to the new programmer.
Also, on a more advanced note, I've used https://github.com/ptaoussanis/timbre with great success to get nicely formatted and colored Clojure errors and stack traces.
Re: Clojure Distilled
#34I am really suggesting to try some classic Scheme course first, like my favorite CS61A by Brian Harvey, or that wonderful Racket-based course (what's the difference?) on Coursera by Gregor Kiczales (which is worth watching even if you are mere a brainwashed Java dev). Another way is through pg's books, especially, of course, "On Lisp" and Arc tutorial and then arc.arc (original version from the 2009 arc3.tar which is…
I see where you're coming from, SLW.
Re: Clojure Distilled
#35(defk login (user pass) (and (string= user "Bob") (string= pass "secret")))
(login (list-to-hash '(user "Bob" pass "secret")) (list-to-hash '(user "Bob" pass "secret"))
Given the following definitions:
(defmacro defk(name h-list &rest body) `(defun ,name (h) (let ,h-list ,@(loop for k in h-list collect `(setq ,k (gethash (quote ,k) h))) ,@body)))
(defun list-to-hash(list) (let ((h (make-hash-table))) (loop for (k v) on list by #'cddr do (setf (gethash k h) v)) h))
Re: Clojure Distilled
#36I'm currently learning Clojure. For all the "aha!" moments, there are plenty of "WTFs?", too. Not that it's a fault of the language, it's just that it requires a different way of looking at things. I've only skimmed this article, but look forward to reading it in depth later. Thanks! I'd be interested if anyone has some similar pieces to share.
My personal favorite editor is IntelliJ IDEA Community Edition + cursiveclojure.com plugin (not affiliated with the cursiveclojure.com people but highly recommend it). I don't come from an Emacs background but from what I've seen and heard from Emacs people is that it combines all the best parts of Emacs when it comes to Lisp code manipulation.
Re: Clojure Distilled
#37 Higher order functions can be easily chained
together to create complex transformations:
(filter even?
(map #(* 3 %) [1 2 3 4 5]))
=>(6 12)
This will need to be updated to make use of transducers, I guess.Re: Clojure Distilled
#38I've been working with Clojure for 18 months now, after a bit more than 10 years of Java. I'm having so much fun I don't think I could ever go back. Also, this is an excellent summary / introduction to key clojure concepts, well done to the author.
Fantastic introductory guide. Clojure really needs something like this. There are some good books on Clojure but I find they are aimed at either the determined beginner or the experienced (or both.) This though I feel I could pass around to anyone that wants to get an idea of what Clojure is about.
Re: Clojure Distilled
#39Earlier quoted context omitted.
I also am a long time emacs user, but whenever a plugin freezes emacs I immediately stop using it. Is is cider now stable? I know nrepl.el would crash emacs frequently if you asked it to evaluate the wrong thing.
I'm not sure how long this feature has been around, but C-c C-b will abort any running evaluation(s)... I've used it more than once to save a non-responsive cider repl session.
Thank you.
Re: Clojure Distilled
#40Higher order functions can be easily chained together to create complex transformations: (filter even? (map #(* 3 %) [1 2 3 4 5])) =>(6 12) This will need to be updated to make use of transducers, I guess.