About This

If all goes well, this will become a little online Clojure tutorial for the Facebook Clojure Community.

If it doesn't go well, blame me - my name is Carl Smotricz and I'm the only (so far) author.

I'm no Clojure guru. I'm an enthusiast looking to share my enthusiasm with others. Comments, suggestions, criticism, contributions are welcome.

1. Hello World on the Cheap

Nightcode lets you easily execute simple expressions on the fly.

The bottom left corner is a REPL, a "Read-Eval-Print Loop". You type in an expression and Nightcode/Clojure will tell you what happened:


So just to see that that works, after the bottom-most "user=>" prompt, type in

(println "Hello, World!")

...and finish with ENTER, of course.

This is what should happen:


While we're here, there's something else useful and important you should know about: Clojure has a doc function that gives you the documentation for any function. Like every function in any Lisp (including Clojure), you execute it by putting it into parentheses along with its argument(s).

Let's say you weren't able to guess what println does! Here's what you do:



... and here's what you get:


If you want, you can follow your curiosity down to "print":


You may have noticed I pulled the window tile a bit taller and wider to make room for the text. You can do that too!

The argument description ([& more]) is a bit weird. Don't worry about that for now!

No comments:

Post a Comment