Skip to content

Instantly share code, notes, and snippets.

@NanoDano
Created June 3, 2020 20:33
Show Gist options
  • Save NanoDano/6cf4067f28edb085f44931ecdc450ba5 to your computer and use it in GitHub Desktop.
Save NanoDano/6cf4067f28edb085f44931ecdc450ba5 to your computer and use it in GitHub Desktop.
Clojure install and hello world basics

Clojure Basics

Install Java from https://www.java.com/en/download/ Download lein or lein.bat from http://leiningen.org/

lein self-install
lein new <project>
cd <project>
vim project.clj # and add the following:
(defproject leiningen.org "1.0.0"
  :description "Generate static HTML for http://leiningen.org"
  :dependencies [[enlive "1.0.1"]
                 [cheshire "4.0.0"]
                 [org.markdownj/markdownj "0.3.0-1.0.2b4"]]
  :main leiningen.web)
lein deps

Example of a Hello World:

//Hello World
//==========

(ns simple)

(defn hello
  ([] "Hello world!")
  ([name] (str "Hello " name "!")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment