On Tue, Jan 13, 2009 at 3:04 AM, HB <hubaghd...@gmail.com> wrote:
>
> Do you suggest that I read "Programming Clojure" first and then trying
> to study the source code?

That's a fine option.  The book may be a shorter path to *practical*
knowledge.

> What is the best place (file, package or what ever) to start reading
> the source code?

As bOR_ suggested, core.clj is a great place to start:

http://code.google.com/p/clojure/source/browse/trunk/src/clj/clojure/core.clj

Or an unofficial mirror with syntax highlighting:

http://github.com/kevinoneill/clojure/blob/310155ffd520987278262ca641ece6149a77555f/src/clj/clojure/core.clj

At one time, reading that was the best way to learn clojure.  There
are now many more tutorials, examples, and of course Holloway's book,
but especially if you *want* to read code, that's a good place to
start.

While a lot of Clojure's features are implemented there, a good many
are also implemented in java.  You'll find in reading core.clj that it
frequently calls static methods of RT.java.  It also calls into the
various collection (hash, vector, set, etc.) and reference (agent,
ref, atom, var) classes, which are largely independent of each other.
All this makes core.clj a good place to start, as it can lead you to
the others as you go along.

It may not, however, lead you to LispReader.java or Compiler.java.
The former is for consuming a Java IO Reader and producing Clojure
objects to be macroexpanded and compiled, so read that if you want to
learn how Clojure parses text.  The latter gleans deeper knowledge
about the structure of Clojure expressions and produces Java
bytecode -- not for the faint of heart.

One thing to keep in mind when reading core.clj is that some Clojure
idioms are impossible at the beginning of the file, as the tools they
need haven't been created yet.  So don't take all of it as necessarily
the best way to write your own Clojure code.

--Chouser

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to