Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Learning Clojure by reading core.clj

Tags:

clojure

I came across the tweet today:

Start each day by reading the implementation of a function or macro in Clojure's core.clj.

My Clojure knowledge is really basic, I can hardly read other's Clojure (or Lisp) code.
Can I do well with core.clj, especially I have the feeling it is full of complicated macros?

like image 499
Chiron Avatar asked Nov 11 '10 02:11

Chiron


1 Answers

I think a better place to start is by doing a project; anything that interests you and seems manageable is good.

core.clj is not readable right now; perhaps the latter half is, but the first half isn't something I'd wish on anyone as an introduction to the language. The truth is, even if you read it very carefully, you'd not have a solid idea of what was going on without also reading a lot of Java code, too.

  • Make an asynchronous text-based game (technomancy—Phil Hagelburg—has a nice one to look through on his Github, though it's a little dated by now)
  • Scrape websites using the Enlive library.
  • Maybe just solve some math problems, and/or
  • Graph things using Incanter.

Build first. Once you acquaint yourself with the tools you are using, start reading them. The libraries mentioned here are well written (you can't go wrong with anything by Christophe Grand, for instance), and once you start using them, you'll understand what they do, which makes it much simpler to figure out the why and how later.

like image 135
Isaac Avatar answered Oct 02 '22 02:10

Isaac