목차

Defining a Function

(defn functionname
   “optional documentation string”
   [arguments]
   (code block))

Example

(ns clojure.examples.hello
   (:gen-class))

;; This program displays Hello World
(defn Example []
   (def x 1)
   (def y 1.25)
   (def str1 "Hello")
   (println x)
   (println y)
   (println str1))
   
(Example)

Output

1
1.25
Hello

Refs


관련 문서