open:cond

cond

cond
(expression evaluation1) statement #1
(expression evaluation2) statement #2
(expression evaluationN) statement #N
:else statement #Default

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

;; This program displays Hello World
(defn Example []
   (def x 5)
   (cond
      (= x 5) (println "x is 5")
      (= x 10)(println "x is 10")
      :else (println "x is not defined")))
      
(Example)

Output

x is 5

  • open/cond.txt
  • 마지막으로 수정됨: 2021/11/22 23:44
  • 저자 127.0.0.1