Clojure: Hello, World!

What is Clojure?

  • Clojure is a Dialect of Lisp run on JVM

Install Leiningen on CentOS 7

  • wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
  • sudo mv lein /usr/local/bin/.
  • sudo chmod a+x /usr/local/bin/lein
  • lein

Hello, World!

  • lein new hello-world
  • cd hello-world
  • vi project.clj
(defproject hello-world "0.1.0-SNAPSHOT"
  :main hello-world.core
  :dependencies [[org.clojure/clojure "1.10.0"]])
  • vi src/hello-world/core.clj
(ns hello-world.core)

(defn -main [& args]
  (println "Hello, World!"))
  • lein run

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer