Skip to content

Instantly share code, notes, and snippets.

@devn
Created May 25, 2010 20:44
Show Gist options
  • Select an option

  • Save devn/413667 to your computer and use it in GitHub Desktop.

Select an option

Save devn/413667 to your computer and use it in GitHub Desktop.
(def tutorial-defn-1
(html
[:p.bottom "So, you wanna learn Clojure... Perhaps you're in it for the Lisp, or the JVM goodness. Perhaps you'd like to get your I/O on without a monad after a brief bout with Haskell. Perhaps you're a language nerd, the kind of guy who just finished up investigating Scala or Erlang. I regret to inform you that none of the above will be considered in the following tutorial. This tutorial has been systematically decoupled from theory, and is instead filled with garbage. Delicious, fragrant garbage. The kind of garbage that makes you stop and take a few more whiffs. It's like maple syrup...only more pungent. The trouble with this kind of garbage is that you never get to do anything with it. The garbage *you* need is the kind of garbage you can sink your feet into and wiggle your toes around. So, without further ado I present to you: The Most Garbage Tutorial Ever Conceived By A Dolphin."]
[:p.bottom "I know what you're thinking: \"This is ridiculous! Clojure is a *serious* language for *serious* folk! Dolphins need not apply!\" And of course, you'd be right. Clojure is a very serious language. The problem we have at the moment, though, is that it is unfortunately filled to the brim with garbage. It's chock full of it! Your mission, should you choose to accept it, is to clean up a whole bunch of litter and junk."]
[:p.bottom "Don't make me beg; I'm only a dolphin. Click 'Next' to get on with it already."]))
(def tutorial-defn-2
(html
[:p.bottom "You wake up in a dark room. The smell of delicious garbage on your nostrils stings so good you almost forget to turn on the light, and then you forget to turn on the light completely. It's still dark. You stumble around. Ho ho ho, what's this? A piece of garbage! Your mission begins!"]
[:p.bottom "It's ironic, but you'll need to create the garbage for yourself in the REPL (Read Eval Print Loop) above: " (code "(def crud \"crud\"")]
[:p.bottom "Now you've got to find a waste basket to throw this crud into. You feel around in the dark for several hours, receiving a comical number of lumps and bruises in the process. There's no waste basket in here. What are you going to do now, tough guy?"]
[:p.bottom "I knew you'd give up. They all do... Here's a thought: " (code "(reverse crud)")]
[:p.bottom "Huzzah! You've turned that crud into \"durc\"! We'll need to verify your actions have not been in vain: " (code "\"crud\"")]
[:p.bottom "Ah, yes... I forgot to tell you... In Clojure, \"stuff\" is immutable. That means it can't change...ever. It can only be transformed by a function, like " (code "reverse")]
[:p.bottom]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment